Commit 2fd606e8 authored by yched's avatar yched

#153284 - fix unneeded views_get_views call when 'advanced (Views) node selection' is not used,

resulting in repeated "SELECT v.* FROM view_view v WHERE v.name = '--' " queries.
thanks to moggy for noticing this _and_ pinning this down to noderef field
parent d4f8afdc
......@@ -379,7 +379,7 @@ function nodereference_widget($op, &$node, $field, &$items) {
* Fetch an array of all candidate referenced nodes, for use in presenting the selection form to the user.
*/
function _nodereference_potential_references($field, $return_full_nodes = FALSE, $string = '', $exact_string = false) {
if (module_exist('views') && ($view = views_get_view($field['advanced_view']))) {
if (module_exist('views') && $field['advanced_view'] != '--' && ($view = views_get_view($field['advanced_view']))) {
// advanced field : referenceable nodes defined by a view
// let views.module build the query
......@@ -475,7 +475,7 @@ function nodereference_autocomplete($field_name, $string = '') {
}
function _nodereference_item($field, $item, $html = false) {
if (module_exist('views') && ($view = views_get_view($field['advanced_view']))) {
if (module_exist('views') && $field['advanced_view'] != '--' && ($view = views_get_view($field['advanced_view']))) {
$output = theme('nodereference_item_advanced', $item, $view);
if (!$html) {
// Views theming runs check_plain (htmlentities) on the values.
......
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