Commit f86c2415 authored by yched's avatar yched

Issue #998494 by zhangtaihao: Fix Node Reference field always displaying 10...

Issue #998494 by zhangtaihao: Fix Node Reference field always displaying 10 results when using the Advanced View option (Views 6.x-3.x compatibility).
parent fff25458
......@@ -2,7 +2,10 @@ CCK 6.x-2.x-dev
===========
Bugfixes:
- Issue #1401950 by KarenS, Add empty test module with dependency on schema to make schema available to testbot.
- #1401950 by KarenS, Add empty test module with dependency on schema to make
schema available to testbot.
- #998494 by zhangtaihao: Fix Node Reference field always displaying 10 results
when using the Advanced View option (with Views 6.x-3.x)
CCK 6.x-2.9
===========
......
......@@ -182,7 +182,7 @@ function nodereference_field_settings($op, $field) {
*/
function nodereference_field($op, &$node, $field, &$items, $teaser, $page) {
static $sanitized_nodes = array();
switch ($op) {
// When preparing a translation, load any translations of existing references.
case 'prepare translation':
......@@ -860,8 +860,15 @@ function _nodereference_potential_references_views($field, $string = '', $match
// should be moved to content_plugin_display_references
// Limit result set size.
// - Views 3.x uses set_items_per_page(),
// - Views 2.x uses set_option('items_per_page').
$limit = isset($limit) ? $limit : 0;
$view->display_handler->set_option('items_per_page', $limit);
if (method_exists($view, 'set_items_per_page')) {
$view->set_items_per_page($limit);
}
else {
$view->display_handler->set_option('items_per_page', $limit);
}
// Get arguments for the view.
if (!empty($field['advanced_view_args'])) {
......
......@@ -725,8 +725,15 @@ function _userreference_potential_references_views($field, $string = '', $match
// should be moved to content_plugin_display_references
// Limit result set size.
// - Views 3.x uses set_items_per_page(),
// - Views 2.x uses set_option('items_per_page').
$limit = isset($limit) ? $limit : 0;
$view->display_handler->set_option('items_per_page', $limit);
if (method_exists($view, 'set_items_per_page')) {
$view->set_items_per_page($limit);
}
else {
$view->display_handler->set_option('items_per_page', $limit);
}
// Get arguments for the view.
if (!empty($field['advanced_view_args'])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment