I'm getting a ton of these notices when executing my query.

happening in function add_table():
$join = $this->get_join_data($table, $this->relationships[$relationship]['base']);

where being called w/ a $relationship is empty. I tried to trace thru the bail-out function call ensure_path which is called directly above but couldn't.

The table being used holds date information. I'm using in in two different filters -- not sure if this has anything to do with the issue. Both instances of this table's use are in different halves of an ORed (views_or) set of clauses.

Things seem to work, so this is really only a case of TONS of notices being sent to the error log.

Please let me know if you need more information.

CommentFileSizeAuthor
#7 views.patch726 bytestoddgee
#5 views.patch622 bytestoddgee
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)
I'm using in in two different filters -

Is it your own filter handler?
If yes, you could post the definition of the views_data and the filter class, else
you could pastebin the export of the view

toddgee’s picture

I'm not implementing my own filter handler -- everything is straight views.

Here's the export of the view:
$view = new view;
$view->name = 'product_views';
$view->description = 'The main product views including the front page view';
$view->tag = 'product';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
'nid' => array(
'label' => 'Nid',
'alter' => array(
'alter_text' => 0,
'text' => '/node/[nid]/component',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'exclude' => 0,
'id' => 'nid',
'table' => 'node',
'field' => 'nid',
'relationship' => 'none',
),
'field_product_pictures_fid' => array(
'label' => 'Pictures',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'label_type' => 'widget',
'format' => 'thumb_default',
'multiple' => array(
'group' => 1,
'multiple_number' => '1',
'multiple_from' => '0',
'multiple_reversed' => 0,
),
'exclude' => 0,
'id' => 'field_product_pictures_fid',
'table' => 'node_data_field_product_pictures',
'field' => 'field_product_pictures_fid',
'relationship' => 'none',
),
'title' => array(
'label' => 'Title',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'relationship' => 'none',
),
'field_product_ebay_id_value' => array(
'label' => 'eBay auction ID',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'label_type' => 'widget',
'format' => 'default',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_product_ebay_id_value',
'table' => 'node_data_field_product_ebay_id',
'field' => 'field_product_ebay_id_value',
'relationship' => 'none',
),
'field_product_ebay_auction_end_value' => array(
'label' => 'eBay auction end date',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'label_type' => 'widget',
'format' => 'default',
'multiple' => array(
'multiple_number' => '',
'multiple_from' => '',
'multiple_to' => '',
'group' => TRUE,
),
'repeat' => array(
'show_repeat_rule' => '',
),
'fromto' => array(
'fromto' => 'both',
),
'exclude' => 0,
'id' => 'field_product_ebay_auction_end_value',
'table' => 'node_data_field_product_ebay_auction_end',
'field' => 'field_product_ebay_auction_end_value',
'relationship' => 'none',
),
'field_product_price_value' => array(
'label' => 'Price',
'alter' => array(
'alter_text' => 0,
'text' => '[field_product_price_value]',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'label_type' => 'widget',
'format' => 'default',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_product_price_value',
'table' => 'node_data_field_product_price',
'field' => 'field_product_price_value',
'relationship' => 'none',
),
'field_product_date_sold_value' => array(
'label' => 'Date Sold',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'label_type' => 'widget',
'format' => 'default',
'multiple' => array(
'multiple_number' => '',
'multiple_from' => '',
'multiple_to' => '',
'group' => TRUE,
),
'repeat' => array(
'show_repeat_rule' => '',
),
'fromto' => array(
'fromto' => 'both',
),
'exclude' => 0,
'id' => 'field_product_date_sold_value',
'table' => 'node_data_field_product_date_sold',
'field' => 'field_product_date_sold_value',
'relationship' => 'none',
),
'field_product_featured_value' => array(
'label' => 'Featured',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'label_type' => 'widget',
'format' => 'unformatted',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_product_featured_value',
'table' => 'node_data_field_product_featured',
'field' => 'field_product_featured_value',
'relationship' => 'none',
),
));
$handler->override_option('sorts', array(
'field_product_featured_value' => array(
'order' => 'DESC',
'delta' => -1,
'id' => 'field_product_featured_value',
'table' => 'node_data_field_product_featured',
'field' => 'field_product_featured_value',
'relationship' => 'none',
),
'nid' => array(
'order' => 'DESC',
'id' => 'nid',
'table' => 'node',
'field' => 'nid',
'relationship' => 'none',
),
));
$handler->override_option('filters', array(
'status_extra' => array(
'operator' => '=',
'value' => '',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'status_extra',
'table' => 'node',
'field' => 'status_extra',
'relationship' => 'none',
),
'type' => array(
'operator' => 'in',
'value' => array(
'product' => 'product',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'relationship' => 'none',
),
'views_or_begin' => array(
'operator' => '=',
'value' => '',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'views_or_begin',
'table' => 'node',
'field' => 'views_or_begin',
'relationship' => 'none',
),
'date_filter' => array(
'operator' => 'empty',
'value' => array(
'value' => array(
'date' => '',
),
'min' => array(
'date' => '',
),
'max' => array(
'date' => '',
),
'default_date' => '',
'default_to_date' => '',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'date_fields' => array(
'node_data_field_product_date_sold.field_product_date_sold_value' => 'node_data_field_product_date_sold.field_product_date_sold_value',
),
'date_method' => 'OR',
'granularity' => 'day',
'form_type' => 'date_text',
'default_date' => '',
'default_to_date' => '',
'year_range' => '-3:+3',
'id' => 'date_filter',
'table' => 'node',
'field' => 'date_filter',
'relationship' => 'none',
),
'views_or_next' => array(
'operator' => '=',
'value' => '',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'views_or_next',
'table' => 'node',
'field' => 'views_or_next',
'relationship' => 'none',
),
'date_filter_1' => array(
'operator' => '>=',
'value' => array(
'value' => NULL,
'min' => NULL,
'max' => NULL,
'default_date' => 'now -5 day',
'default_to_date' => '',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'date_fields' => array(
'node_data_field_product_date_sold.field_product_date_sold_value' => 'node_data_field_product_date_sold.field_product_date_sold_value',
),
'date_method' => 'OR',
'granularity' => 'day',
'form_type' => 'date_select',
'default_date' => 'now -5 day',
'default_to_date' => '',
'year_range' => '-3:+3',
'id' => 'date_filter_1',
'table' => 'node',
'field' => 'date_filter',
'relationship' => 'none',
),
'views_or_end' => array(
'operator' => '=',
'value' => '',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'views_or_end',
'table' => 'node',
'field' => 'views_or_end',
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'time',
'results_lifespan' => '-1',
'output_lifespan' => '-1',
));
$handler->override_option('header_format', '2');
$handler->override_option('header_empty', 0);
$handler->override_option('empty', '
No products found

');
$handler->override_option('empty_format', '2');
$handler->override_option('items_per_page', 0);
$handler->override_option('style_options', array(
'grouping' => '',
));
$handler = $view->new_display('page', 'Product Type pages', 'page_1');
$handler->override_option('arguments', array(
'tid' => array(
'default_action' => 'not found',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => '',
'wildcard_substitution' => 'All',
'title' => '',
'breadcrumb' => '',
'default_argument_type' => 'fixed',
'default_argument' => '',
'validate_type' => 'php',
'validate_fail' => 'not found',
'break_phrase' => 0,
'add_table' => 0,
'require_value' => 0,
'reduce_duplicates' => 0,
'set_breadcrumb' => 0,
'id' => 'tid',
'table' => 'term_node',
'field' => 'tid',
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
'2' => 0,
'3' => 0,
'5' => 0,
'4' => 0,
),
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_user' => 0,
'default_argument_fixed' => '',
'default_argument_php' => '',
'validate_argument_node_type' => array(
'webform' => 0,
'page' => 0,
'product' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'1' => 1,
),
'validate_argument_type' => 'convert',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'validate_argument_php' => '// vocab ID for the product type taxonomy
$PRODUCT_TYPE_VID = 1;

//drupal_set_message(\'argument: \' . $argument);

$tree = taxonomy_get_tree($PRODUCT_TYPE_VID);
foreach ($tree as $term) {
$termxform = str_replace(array(" ", "/"), "-", $term->name);
//drupal_set_message(\'term->name:\' . $term->name . \' termxform:\' . $termxform);

if ($termxform == $argument) {
$handler->argument = $term->tid;
return TRUE;
}
}

return FALSE;
',
),
));
$handler->override_option('path', 'products/%');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
));
$handler = $view->new_display('page', 'Front page', 'page_2');
$handler->override_option('filters', array(
'status_extra' => array(
'operator' => '=',
'value' => '',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'status_extra',
'table' => 'node',
'field' => 'status_extra',
'relationship' => 'none',
),
'type' => array(
'operator' => 'in',
'value' => array(
'product' => 'product',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'relationship' => 'none',
),
'views_or_begin' => array(
'operator' => '=',
'value' => '',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'views_or_begin',
'table' => 'node',
'field' => 'views_or_begin',
'relationship' => 'none',
),
'date_filter' => array(
'operator' => 'empty',
'value' => array(
'value' => array(
'date' => '',
),
'min' => array(
'date' => '',
),
'max' => array(
'date' => '',
),
'default_date' => '',
'default_to_date' => '',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'date_fields' => array(
'node_data_field_product_date_sold.field_product_date_sold_value' => 'node_data_field_product_date_sold.field_product_date_sold_value',
),
'date_method' => 'OR',
'granularity' => 'day',
'form_type' => 'date_text',
'default_date' => '',
'default_to_date' => '',
'year_range' => '-3:+3',
'id' => 'date_filter',
'table' => 'node',
'field' => 'date_filter',
'relationship' => 'none',
),
'views_or_next' => array(
'operator' => '=',
'value' => '',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'views_or_next',
'table' => 'node',
'field' => 'views_or_next',
'relationship' => 'none',
),
'date_filter_1' => array(
'operator' => '>=',
'value' => array(
'value' => NULL,
'min' => NULL,
'max' => NULL,
'default_date' => 'now -5 day',
'default_to_date' => '',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'date_fields' => array(
'node_data_field_product_date_sold.field_product_date_sold_value' => 'node_data_field_product_date_sold.field_product_date_sold_value',
),
'date_method' => 'OR',
'granularity' => 'day',
'form_type' => 'date_select',
'default_date' => 'now -5 day',
'default_to_date' => '',
'year_range' => '-3:+3',
'id' => 'date_filter_1',
'table' => 'node',
'field' => 'date_filter',
'relationship' => 'none',
),
'views_or_end' => array(
'operator' => '=',
'value' => '',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'views_or_end',
'table' => 'node',
'field' => 'views_or_end',
'relationship' => 'none',
),
'field_product_featured_value_many_to_one' => array(
'operator' => 'or',
'value' => array(
'1' => '1',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'field_product_featured_value_many_to_one',
'table' => 'node_data_field_product_featured',
'field' => 'field_product_featured_value_many_to_one',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
'reduce_duplicates' => 0,
),
));
$handler->override_option('path', 'home');
$handler->override_option('menu', array(
'type' => 'normal',
'title' => 'Home',
'description' => '',
'weight' => '-50',
'name' => 'primary-links',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
));

toddgee’s picture

Here's the diff of the hack I put in to get around the notices. Without it I get 100s of notice level warnings...:

$ cvs diff -C 12 query.inc
Index: query.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/includes/query.inc,v
retrieving revision 1.50.2.4
diff -C 12 -r1.50.2.4 query.inc
*** query.inc 2 Dec 2009 22:59:18 -0000 1.50.2.4
--- query.inc 7 Dec 2009 18:58:03 -0000
***************
*** 245,269 ****
--- 245,271 ----
* @return $alias
* The alias of the table; this alias can be used to access information
* about the table and should always be used to refer to the table when
* adding parts to the query. Or FALSE if the table was not able to be
* added.
*/
function add_table($table, $relationship = NULL, $join = NULL, $alias = NULL) {
if (!$this->ensure_path($table, $relationship, $join)) {
return FALSE;
}

if (!$join) {
+ if (key_exists($relationship, $this->relationships)) {
$join = $this->get_join_data($table, $this->relationships[$relationship]['base']);
+ }
}

$join = $this->adjust_join($join, $relationship);

return $this->queue_table($table, $relationship, $join, $alias);
}

/**
* Add a table to the query, without ensuring the path.
*
* This function will test to ensure that the path back to the primary
* table is valid and exists; if you do not wish for this testing to

dawehner’s picture

Status: Postponed (maintainer needs more info) » Needs work

Can you make a patch file out of it?

toddgee’s picture

Status: Needs work » Active
FileSize
622 bytes

Sorry... didn't see what was going on.

here's the patch.

dawehner’s picture

Status: Active » Needs work

Please fix the codestyle

toddgee’s picture

Status: Needs work » Active
FileSize
726 bytes

codestyle fixed

dawehner’s picture

Status: Active » Needs review

update

merlinofchaos’s picture

What happens if the key doesn't exist? It'll fall through and try to adjust the non-existent join. Isn't this bad?

merlinofchaos’s picture

Status: Needs review » Needs work
toddgee’s picture

Status: Needs work » Needs review

Dunno' but I do know that with the supplied patch in place I don't get lots of warnings out on the console.

dawehner’s picture

Status: Needs review » Needs work

If you dunno there is no reason that it keeps on NR

esmerel’s picture

Status: Needs work » Closed (won't fix)

No activity on patch for more than 30 days.

mr.baileys’s picture

For later reference, this seems like a duplicate of #887768: Notice: Undefined index: in views_query->add_table().