I am using drupal 7 with views-7.x-3.x-dev (2011-Apr-09).
My view has a Contextual filter "Taxonomy term: Name". I use basic validation for this filter.

# If the view is called without an argument, all is shown correctly.

# If the view is called with an argument (name of a taxonomy term), I get these errors:
Notice: Undefined property: stdClass::$left_table in views_plugin_query_default->ensure_path() (Zeile 595 von /var/www/1/sites/all/modules/views/plugins/views_plugin_query_default.inc).

Notice: Undefined property: stdClass::$left_table in views_plugin_query_default->ensure_path() (Zeile 596 von /var/www/1/sites/all/modules/views/plugins/views_plugin_query_default.inc).

Notice: Undefined property: stdClass::$left_table in views_plugin_query_default->ensure_path() (Zeile 606 von /var/www/1/sites/all/modules/views/plugins/views_plugin_query_default.inc).

Notice: Undefined property: stdClass::$left_table in views_plugin_query_default->ensure_path() (Zeile 612 von /var/www/1/sites/all/modules/views/plugins/views_plugin_query_default.inc).

Notice: Undefined property: stdClass::$left_table in views_plugin_query_default->ensure_path() (Zeile 613 von /var/www/1/sites/all/modules/views/plugins/views_plugin_query_default.inc).

Notice: Undefined property: stdClass::$left_table in views_plugin_query_default->ensure_path() (Zeile 614 von /var/www/1/sites/all/modules/views/plugins/views_plugin_query_default.inc).

Notice: Undefined property: stdClass::$left_table in views_plugin_query_default->ensure_path() (Zeile 618 von /var/www/1/sites/all/modules/views/plugins/views_plugin_query_default.inc).

Notice: Undefined property: stdClass::$left_table in views_plugin_query_default->ensure_path() (Zeile 619 von /var/www/1/sites/all/modules/views/plugins/views_plugin_query_default.inc).

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= 'Google-Android') ))) subquery' at line 1: SELECT COUNT(*) AS expression FROM (SELECT 1 AS expression FROM {node} node WHERE (( (node.status = :db_condition_placeholder_0) AND (node.type IN (:db_condition_placeholder_1)) AND (.name = :db_condition_placeholder_2) ))) subquery; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => smartphone [:db_condition_placeholder_2] => Google-Android ) in views_plugin_pager->execute_count_query() (Zeile 140 von /var/www/1/sites/all/modules/views/plugins/views_plugin_pager.inc).

My last used views-dev from the beginning of March didn't show these errors. These showed up after updating to the views-dev of april-09.

Comments

merlinofchaos’s picture

Status: Active » Fixed

The taxonomy bits were redone; it may now be that particular argument needs to be used with a relationship. You can add a relationship on the term reference field or a general relationship with Content: Taxonomy terms on node. Then limit the relationship to what vocabularies you want it to search on. Then edit your contextual filter and save it to ensure it picks up the relationship.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dqd’s picture

Merlin, if you don't mind, could you give more details about the changes you mentioned? If I understood correctly (I am german), taxonomy term name isn't available no more (I can confirm that I can't find it no more on latest views dev 7.3 with D7) and that I have to go another way around to get a working contextual filter searching for a term name in the url instead of the term ID? I can't find anything about it in the documentations or advanced help.

elachlan’s picture

Status: Closed (fixed) » Active

I have the same issue and I can confirm I have a relationship "Content: Taxonomy terms on node" and the view works fine.

I still get error messages in my log:

Notice: Undefined property: stdClass::$left_table in views_plugin_query_default->ensure_path() (line 629 of /www/sites/all/modules/views/plugins/views_plugin_query_default.inc).

The error occurs when /[viewURL/[TermName]/Lists/Categories/ViewCategory.aspx?ID=1 is accessed.

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

Can you give an export of a view which has this behaviour, so it's possible to reproduce this problem?

Once someone can reproduce it, the problem is often fixed quite easy.

elachlan’s picture

Version: 7.x-3.x-dev » 7.x-3.0-rc1
StatusFileSize
new8.92 KB

Attached is the exported view.

dawehner’s picture

Okay i tryed to use this view here, but it works fine without any notices. Mh

dawehner’s picture

Status: Postponed (maintainer needs more info) » Active

Okay can reproduce the issue now.

dawehner’s picture

elachlan’s picture

Great! Is there anything else I can do?

The code..

    // Keep looking.
    $traced[$join->left_table] = TRUE;
    return $this->ensure_path($join->left_table, $relationship, $left_join, $traced, $add);

This is at the end of the function ensure_path($table, $relationship = NULL, $join = NULL, $traced = array(), $add = array()) {

Not sure if that helps at all.

dawehner’s picture

Try to paste a view which "works" on a clean drupal7 installation and is as simple as possible.
This would really help to fix the problem.

elachlan’s picture

It looks like a client or web crawler is trying to access an old page or news article from when the website was not using drupal.

So every time an invalid URL is typed in and requested, because its inside the URL of the view it can't find the taxonomy term.

So I think it may only be a problem when an invalid taxonomy term is entered. (like a url to an old webpage)

elachlan’s picture

Errors are occurring multiple times per request.

These are a set of errors that I received when it was trying to access: http://www.expert1.com.au/News/ibs/_layouts/listfeed.aspx?List=ee70681b-...

The view is under /News

Notice: Undefined property: stdClass::$left_table in views_plugin_query_default->ensure_path() (line 605 of /clientdata/apache-www/e/x/expert1.com.au/www/sites/all/modules/views/plugins/views_plugin_query_default.inc).
Notice: Undefined property: stdClass::$left_table in views_plugin_query_default->ensure_path() (line 606 of /clientdata/apache-www/e/x/expert1.com.au/www/sites/all/modules/views/plugins/views_plugin_query_default.inc).
Notice: Undefined property: stdClass::$left_table in views_plugin_query_default->ensure_path() (line 616 of /clientdata/apache-www/e/x/expert1.com.au/www/sites/all/modules/views/plugins/views_plugin_query_default.inc).
Notice: Undefined property: stdClass::$left_table in views_plugin_query_default->ensure_path() (line 622 of /clientdata/apache-www/e/x/expert1.com.au/www/sites/all/modules/views/plugins/views_plugin_query_default.inc).
Notice: Undefined property: stdClass::$left_table in views_plugin_query_default->ensure_path() (line 623 of /clientdata/apache-www/e/x/expert1.com.au/www/sites/all/modules/views/plugins/views_plugin_query_default.inc).
Notice: Undefined property: stdClass::$left_table in views_plugin_query_default->ensure_path() (line 624 of /clientdata/apache-www/e/x/expert1.com.au/www/sites/all/modules/views/plugins/views_plugin_query_default.inc).
Notice: Undefined property: stdClass::$left_table in views_plugin_query_default->ensure_path() (line 628 of /clientdata/apache-www/e/x/expert1.com.au/www/sites/all/modules/views/plugins/views_plugin_query_default.inc).
Notice: Undefined property: stdClass::$left_table in views_plugin_query_default->ensure_path() (line 629 of /clientdata/apache-www/e/x/expert1.com.au/www/sites/all/modules/views/plugins/views_plugin_query_default.inc).
elachlan’s picture

Error occurs when terms are correct as well. Very weird.

ryne.andal’s picture

Anyone else have more information about this? I am on the verge of reworking an entire site's functionality because of changes made to this filter. It was working for me in March, like I mentioned previously.

MBroberg’s picture

I just ran into an issue when the name of the filter was "name." Changing the filter identifier fixed it. Could be related?

elachlan’s picture

I create a blank view with a feed and the same relationship and term filter. I did not get errors. I think I might need to recreate the view and make changes step by step until I find why its broken.

ryne.andal’s picture

Try checking the 'allow multiple filter values' checkbox and see if it breaks then. That seems to do it for me.

elachlan’s picture

If I tick that option its worse. It goes into a loop and I get a server 500 error.

Notice: Trying to get property of non-object in views_many_to_one_helper->add_table() (line 716 of /www/sites/all/modules/views/includes/handlers.inc).
elachlan’s picture

Priority: Normal » Major

It generated 8000 pages in the log and counting. THAT IS A MAJOR BUG!

jeffschuler’s picture

subscribing

OldAccount’s picture

Subscribing, confirm the same error mentioned in comment #19.

ryne.andal’s picture

StatusFileSize
new20.15 KB

I was told my issue regarding this problem was related to http://drupal.org/node/1112854
After applying the patch that was committed in this issue, I am still having this issue. This is rather critical for me as a developer, because using multiple filter values using taxonomies is pretty crucial to my workflow.

This should be relatively straightforward for views, and was working in March. I've attached the view that is broken and the query that is generated by Views. The query is missing the two arguments I am passing it, though.

SELECT DISTINCT node.title AS node_title, node.nid AS nid, node.created AS node_created
FROM 
{node} node
LEFT JOIN (SELECT td.*, tn.nid AS nid
FROM 
{taxonomy_term_data} td
LEFT JOIN {taxonomy_vocabulary} tv ON td.vid = tv.vid
LEFT JOIN {taxonomy_index} tn ON tn.tid = td.tid
WHERE  (tv.machine_name IN  ('news_categories')) ) taxonomy_term_data_node ON node.nid = taxonomy_term_data_node.nid
WHERE (( (node.status = '1') AND (node.type IN  ('article')) AND (taxonomy_term_data_node.name = 'health') ))
ORDER BY node_created DESC
dawehner’s picture

If there is something not straightforward then it's taxonomy.

ryne.andal’s picture

Meaning it's an issue with taxonomies? I don't see how the generated query would ever work, considering how the taxonomy_index table contains an entry for each taxonomy associated with a node.

sangwo’s picture

Component: Miscellaneous » Code
Status: Active » Needs review

Using this recursion break condition

if (empty($join) || !isset($join->left_table)) {

instead of the original one

if (empty($join)) {

near line 600 of the /sites/all/modules/views/plugins/views_plugin_query_default.inc file seems to fix this bug for me.

dawehner’s picture

Status: Needs review » Needs work

Could you please create a real patch? This would be somehow easier to review and apply.

dqd’s picture

Wanted to provide a patch here but info is missleading. There is no if (empty($join)) { near line 600 in branch 7.x-3.x on git.

only in line 419

     // If no join is specified, pull it from the table data.
    if (!isset($join)) {
      $join = $this->get_join_data($table, $this->relationships[$relationship]['base']);
      if (empty($join)) {
        return FALSE;
      }
 
dawehner’s picture

Could you please first try out to use views 7.x-3.x and see whether the issue is fixed there already?

ryne.andal’s picture

Looking into this issue yet again, using 7.x-3.0-dev, I tried setting up a view that filters on multiple taxonomies using the contextual filter - Content: Has taxonomy term ID. When I tick the box for "Allow multiple filter values to work together" and add two term ID's (5 and 7) the view returns this query

SELECT node.title AS node_title, node.nid AS nid, node.created AS node_created
FROM 
{node} node
LEFT JOIN {taxonomy_index} taxonomy_index ON node.nid = taxonomy_index.nid
WHERE (( (node.status = '1') AND (taxonomy_index.tid = '5') ))
ORDER BY node_created DESC
LIMIT 10 OFFSET 0

As you can see, this view is only filtering on one tid, and I'm not even sure how it would work properly if it was applying both tid values to the query, since taxonomy_index is a flat table of nid/tid pairs.

When I modify the query a little bit, it will filter as expected -

SELECT node.title AS node_title, node.nid AS nid, node.created AS node_created
FROM 
{node} node join
(select tid, nid from taxonomy_index where tid = 5) ti1 on node.nid = ti1.nid join
(select tid, nid from taxonomy_index where tid = 7) ti2 on node.nid = ti2.nid
WHERE (node.status = '1')
ORDER BY node_created DESC
LIMIT 10 OFFSET 0

I was just wondering if I was setting up the view incorrectly, or if this is indeed still an issue within Views. My life would be infinitely easier if I could apply multiple tid's as contextual filters. Tell me if there is any way I can expedite a solution for this issue.

heylookalive’s picture

StatusFileSize
new14.89 KB

I've just encountered this issue on latest recommended release.

I've got a location view with relationships for content + taxonomy, and a taxonomy exposed filter with "is one of" as the operator.

This worked fine until I changed the operator to "is all of", and then I got a load of errors, searched the issue queue and both errors point here, here are the errors:

Notice: Undefined property: stdClass::$left_table in views_many_to_one_helper->add_table() (line 790 of /var/www/*/httpdocs/sites/all/modules/contrib/views/includes/handlers.inc).
Notice: Undefined property: stdClass::$left_table in views_many_to_one_helper->add_table() (line 791 of /var/www/*/httpdocs/sites/all/modules/contrib/views/includes/handlers.inc).
Notice: Trying to get property of non-object in views_many_to_one_helper->add_table() (line 790 of /var/www/vhosts/*/httpdocs/sites/all/modules/contrib/views/includes/handlers.inc).
Notice: Trying to get property of non-object in views_many_to_one_helper->add_table() (line 791 of /var/www/vhosts/*/httpdocs/sites/all/modules/contrib/views/includes/handlers.inc).

Attached is an export of the view.

anou’s picture

Hello,
"same" for me.
here's the errors

Notice: Trying to get property of non-object in views_many_to_one_helper->add_table() (line 790 of /.../sites/all/modules/views/includes/handlers.inc).
Notice: Trying to get property of non-object in views_many_to_one_helper->add_table() (line 791 of /.../sites/all/modules/views/includes/handlers.inc).

and this made my server overload.
It happened when I added a filter of Taxonomy Term term "none in" ("aucun" in french).
And not to mention that to see the list of taxonomy term appears, I have to record the view once, with unknown term, before I can select witch term in the previous missing list.

And sorry but I cannot attach my view to this post because preview isn't functioning (ajax load forever...)

Ashlar’s picture

Version: 7.x-3.0-rc1 » 7.x-3.3
StatusFileSize
new16.41 KB

I am not certain how closely related my experience is, but this and this report, which are close lead to this issue.

Problem: a preview set with two contextual filter values enters an infinite loop without displaying the results of the query. (entering first value only works fine)

View Set-up: I have a content pane in a view that has two similar contextual filters associated with two vocabularies. The pane is defined with arguments set correctly for first and second arguments from the panel and to the correct vocabularies. The contextual filters are both set to term names. A relationship to Terms on the node expose both vocabularies. I created a view page with the same settings an it also fails in the same way.

The attached PDF contains the view export

FAAREIA’s picture

This is my case....i just downloaded the last dev (05-17) and i saw that Contextual term name filter is working fine until you check "Allow multiple values" or "Allow multiple filter values to work together". When you do so, page keeps thiking eternally...

Notice: Trying to get property of non-object en views_many_to_one_helper->add_table() (line 806 ....views\includes\handlers.inc)

Greeting

Extra: in URL, with 'string+string', it works fine (search has results), with 'string,string' not (search does not have results)

yskel’s picture

Just wanted to add an extra detail: the 'Allow multiple values to work together detail' caused the problems mentioned above for me, including hung ajax call and thousands of records in the error log. I was trying to use a 'Taxonomy term on node' relationship to allow use of the term name in the contextual filter. Removing this relationship and using 'Has taxonomy term ID' instead of 'Taxonomy: Term Name' allowed me to use the 'Allow multiple terms' and 'Allow multiple terms to work together' options in the contextual filter as expected.

-EDIT-
I'm using the 5/19/12 views dev version.

razunter’s picture

Same problem as in #32 with lastest dev

ace11’s picture

I'm getting error in Views: Fatal error: Maximum execution time of 30 seconds exceeded

Error occurs when trying to set Filter Criteria - Taxonomy term: Term operator to "is all of"

Here is exported views:

$view = new view;
$view->name = 'avs_pneumatiikka_menu';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'taxonomy_term_data';
$view->human_name = 'AVS pneumatiikka menu';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'AVS tuotekatalogi';
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['query']['options']['query_comment'] = FALSE;
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'tree';
$handler->display->display_options['style_options']['type'] = 'ol';
$handler->display->display_options['style_options']['main_field'] = 'tid';
$handler->display->display_options['style_options']['parent_field'] = 'tid_1';
$handler->display->display_options['row_plugin'] = 'fields';
/* Relationship: Taxonomy term: Parent term */
$handler->display->display_options['relationships']['parent']['id'] = 'parent';
$handler->display->display_options['relationships']['parent']['table'] = 'taxonomy_term_hierarchy';
$handler->display->display_options['relationships']['parent']['field'] = 'parent';
$handler->display->display_options['relationships']['parent']['required'] = 1;
/* Field: Taxonomy term: Name */
$handler->display->display_options['fields']['name']['id'] = 'name';
$handler->display->display_options['fields']['name']['table'] = 'taxonomy_term_data';
$handler->display->display_options['fields']['name']['field'] = 'name';
$handler->display->display_options['fields']['name']['label'] = '';
$handler->display->display_options['fields']['name']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['name']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['name']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['name']['alter']['external'] = 0;
$handler->display->display_options['fields']['name']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['name']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['name']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['name']['alter']['word_boundary'] = 0;
$handler->display->display_options['fields']['name']['alter']['ellipsis'] = 0;
$handler->display->display_options['fields']['name']['alter']['more_link'] = 0;
$handler->display->display_options['fields']['name']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['name']['alter']['trim'] = 0;
$handler->display->display_options['fields']['name']['alter']['html'] = 0;
$handler->display->display_options['fields']['name']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['name']['element_default_classes'] = 1;
$handler->display->display_options['fields']['name']['hide_empty'] = 0;
$handler->display->display_options['fields']['name']['empty_zero'] = 0;
$handler->display->display_options['fields']['name']['hide_alter_empty'] = 1;
$handler->display->display_options['fields']['name']['link_to_taxonomy'] = 1;
$handler->display->display_options['fields']['name']['convert_spaces'] = 0;
/* Field: Taxonomy term: Term ID */
$handler->display->display_options['fields']['tid']['id'] = 'tid';
$handler->display->display_options['fields']['tid']['table'] = 'taxonomy_term_data';
$handler->display->display_options['fields']['tid']['field'] = 'tid';
$handler->display->display_options['fields']['tid']['exclude'] = TRUE;
$handler->display->display_options['fields']['tid']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['tid']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['tid']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['tid']['alter']['external'] = 0;
$handler->display->display_options['fields']['tid']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['tid']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['tid']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['tid']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['tid']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['tid']['alter']['more_link'] = 0;
$handler->display->display_options['fields']['tid']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['tid']['alter']['trim'] = 0;
$handler->display->display_options['fields']['tid']['alter']['html'] = 0;
$handler->display->display_options['fields']['tid']['element_label_colon'] = 1;
$handler->display->display_options['fields']['tid']['element_default_classes'] = 1;
$handler->display->display_options['fields']['tid']['hide_empty'] = 0;
$handler->display->display_options['fields']['tid']['empty_zero'] = 0;
$handler->display->display_options['fields']['tid']['hide_alter_empty'] = 1;
$handler->display->display_options['fields']['tid']['format_plural'] = 0;
/* Field: Taxonomy term: Term ID */
$handler->display->display_options['fields']['tid_1']['id'] = 'tid_1';
$handler->display->display_options['fields']['tid_1']['table'] = 'taxonomy_term_data';
$handler->display->display_options['fields']['tid_1']['field'] = 'tid';
$handler->display->display_options['fields']['tid_1']['relationship'] = 'parent';
$handler->display->display_options['fields']['tid_1']['exclude'] = TRUE;
$handler->display->display_options['fields']['tid_1']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['tid_1']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['tid_1']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['tid_1']['alter']['external'] = 0;
$handler->display->display_options['fields']['tid_1']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['tid_1']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['tid_1']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['tid_1']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['tid_1']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['tid_1']['alter']['more_link'] = 0;
$handler->display->display_options['fields']['tid_1']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['tid_1']['alter']['trim'] = 0;
$handler->display->display_options['fields']['tid_1']['alter']['html'] = 0;
$handler->display->display_options['fields']['tid_1']['element_label_colon'] = 1;
$handler->display->display_options['fields']['tid_1']['element_default_classes'] = 1;
$handler->display->display_options['fields']['tid_1']['hide_empty'] = 0;
$handler->display->display_options['fields']['tid_1']['empty_zero'] = 0;
$handler->display->display_options['fields']['tid_1']['hide_alter_empty'] = 1;
$handler->display->display_options['fields']['tid_1']['format_plural'] = 0;
/* Sort criterion: Taxonomy term: Weight */
$handler->display->display_options['sorts']['weight']['id'] = 'weight';
$handler->display->display_options['sorts']['weight']['table'] = 'taxonomy_term_data';
$handler->display->display_options['sorts']['weight']['field'] = 'weight';
/* Filter criterion: Taxonomy term: Language */
$handler->display->display_options['filters']['language']['id'] = 'language';
$handler->display->display_options['filters']['language']['table'] = 'taxonomy_term_data';
$handler->display->display_options['filters']['language']['field'] = 'language';
$handler->display->display_options['filters']['language']['value'] = array(
  '***CURRENT_LANGUAGE***' => '***CURRENT_LANGUAGE***',
);
/* Filter criterion: Taxonomy term: Vocabulary */
$handler->display->display_options['filters']['vid']['id'] = 'vid';
$handler->display->display_options['filters']['vid']['table'] = 'taxonomy_term_data';
$handler->display->display_options['filters']['vid']['field'] = 'vid';
$handler->display->display_options['filters']['vid']['value'] = array(
  9 => '9',
);
/* Filter criterion: Taxonomy term: Term */
$handler->display->display_options['filters']['tid']['id'] = 'tid';
$handler->display->display_options['filters']['tid']['table'] = 'taxonomy_term_data';
$handler->display->display_options['filters']['tid']['field'] = 'tid';
$handler->display->display_options['filters']['tid']['operator'] = 'and';
$handler->display->display_options['filters']['tid']['value'] = array(
  1210 => '1210',
);
$handler->display->display_options['filters']['tid']['reduce_duplicates'] = 1;
$handler->display->display_options['filters']['tid']['type'] = 'select';
$handler->display->display_options['filters']['tid']['vocabulary'] = 'hytar';
$handler->display->display_options['filters']['tid']['hierarchy'] = 1;

/* Display: Block */
$handler = $view->new_display('block', 'Block', 'block');
inky@inky3d.com’s picture

I seem to be struggling from the same kind of error that has been logged here.

I have a term view listing all terms in a vocabulary.
In the filter criteria I am limiting the view to one vocab. This is all good so far.
Then another filter "Taxonomy Term: Term" is added to filter out a couple of parent terms, so this is set to "is none of".

As soon as this is added, the view stops responding and gives the ajax message:

An AJAX HTTP request terminated abnormally.
Debugging information follows.
Path: /admin/structure/views/view/landing_vocabularies/preview/page_1/ajax
StatusText: 
ResponseText: 
ReadyState: 4

And in the error logs it shows:

Notice: Trying to get property of non-object in views_many_to_one_helper->add_table() (line 825 of /var/drupal/di-drupal-7/sites/all/modules/contrib/views/includes/handlers.inc).

If I change the filter to show "is one of" all works merrily, but this is not the direction I need the filter to work.

I have tested with the latest 7.x-3.x-dev (2012-Oct-10) and the problem remains.

cluther’s picture

I'm also experiencing this issue (Fatal error: Maximum execution time when 'Allow Multiple Values' is selected on Taxonomy Term: Name). Using Views 7.x-3.5, Drupal 7.16, Commerce 7.x-1.3.

View performs as expected when 'Allow Multiple Values' is not selected. For example, passing 'living-room' produces the following Query (assuming 'Transform spaces to dashes' is enabled):

SELECT field_tags_taxonomy_term_data.sku AS field_tags_taxonomy_term_data_sku, field_tags_taxonomy_term_data.product_id AS field_tags_taxonomy_term_data_product_id, field_tags_taxonomy_term_data.title AS field_tags_taxonomy_term_data_title, 'commerce_product' AS field_data_field_image_commerce_product_entity_type
FROM 
{taxonomy_term_data} taxonomy_term_data
INNER JOIN {field_data_field_tags} field_data_field_tags ON taxonomy_term_data.tid = field_data_field_tags.field_tags_tid AND (field_data_field_tags.entity_type = 'commerce_product' AND field_data_field_tags.deleted = '0')
INNER JOIN {commerce_product} field_tags_taxonomy_term_data ON field_data_field_tags.entity_id = field_tags_taxonomy_term_data.product_id
WHERE (( (taxonomy_term_data.name = 'living room') )AND(( (field_tags_taxonomy_term_data.status <> '0') )))
LIMIT 12 OFFSET 0

Enabling 'Allow Multiple Values' creates the error and prevents me from being able to view the query generated by Views. For example, passing "living-room,chairs", "living-room+chairs", "living room,chairs" or "living room+chairs" fails when "Allow Multiple Values" is selected.

However, I did notice that when "Allow Multiple Values" is selected and the Taxonomy name passed to the view contained either dashes (eg: 'living-room') or spaces ("living room") the view's resulting query split its parameters according to the dash (or space) rather than the expected comma or plus. For example, passing "living-room-chairs" or "living room chairs" successfully executes and produces the following query:

SELECT field_tags_taxonomy_term_data.sku AS field_tags_taxonomy_term_data_sku, field_tags_taxonomy_term_data.product_id AS field_tags_taxonomy_term_data_product_id, field_tags_taxonomy_term_data.title AS field_tags_taxonomy_term_data_title, 'commerce_product' AS field_data_field_image_commerce_product_entity_type
FROM 
{taxonomy_term_data} taxonomy_term_data
INNER JOIN {field_data_field_tags} field_data_field_tags ON taxonomy_term_data.tid = field_data_field_tags.field_tags_tid AND (field_data_field_tags.entity_type = 'commerce_product' AND field_data_field_tags.deleted = '0')
INNER JOIN {commerce_product} field_tags_taxonomy_term_data ON field_data_field_tags.entity_id = field_tags_taxonomy_term_data.product_id
WHERE (( (taxonomy_term_data.name IN  ('living', 'room', 'chairs')) )AND(( (field_tags_taxonomy_term_data.status <> '0') )))
LIMIT 12 OFFSET 0

I hope that this is helpful.

kenorb’s picture

Version: 7.x-3.5 » 7.x-3.3

The same problem, page loading endless (views_get_table_join() recurrency).
Changing 'Is all of:' to 'Is one of' fixes the problem.

Screenshot: http://grab.by/hoJO

Error:

ResponseText:
( ! ) Notice: Undefined property: stdClass::$left_table in C:\www\mc\ts\sites\all\modules\contrib\views\includes\handlers.inc on line 817

Full Call Stack available here:
http://pastebin.com/4xXpCRVB

Views: 7.x-3.5

kenorb’s picture

Version: 7.x-3.3 » 7.x-3.5
Jason Dean’s picture

Version: 7.x-3.3 » 7.x-3.5

Similar problem here, using 'Taxonomy term: name' contextual filter.

If I set the filter to 'allow multiple values', a preview using multiple terms works fine. For example, 'audio+video' displays the correct results.

A preview with a single value goes into an endless loop and the log fills with errors. For example, 'video':

Notice: Trying to get property of non-object in views_many_to_one_helper->add_table() (line 824 of /home/jason/webdev/drupal7/sites/cwf/modules/views/includes/handlers.inc).

I have tried using a relationship ('taxonomy terms on node' or relation to the field itself) and it makes no difference.

If I use a contextual filter based on tid instead of term name, everything works fine.

Using Views 7.x-3.5

Yuri’s picture

Yep changing the filter to term ID helps. Although it first seemed that the site was completely broken since that specific view was used all over my site. Using the url of the view helped to change it. Before that, the error kept on, as mentioned before:

Notice: Undefined property: stdClass::$left_table in views_many_to_one_helper->add_table() (line 817 of /home/willy/public_html/sites/all/modules/views/includes/handlers.inc).
Notice: Undefined property: stdClass::$left_table in views_many_to_one_helper->add_table() (line 818 of /home/willy/public_html/sites/all/modules/views/includes/handlers.inc).

Thanks for the workaround.

jjchinquist’s picture

I tested 3 configurations, hope this helps to analyze and solve the problem:

  • Relationship using the Field API + Contextual Filter "Taxonomy Term Name"
    • The system does not register an error, but 0 node items are returned using this combination.
  • Relationship using the Field API + Contextual Filter "Taxonomy Term ID"
    • This filter works as anticipated
    • Non-SEO friendly URLS generated due to the TID being used in the url
  • Relationship using the general relationship "Taxonomy terms associated with this node" + Contextual Filter "Taxonomy Term Name"
    • This filter works as anticipated
    • SEO friendly
    • Use this solution until the one above is fixed
cafuego’s picture

I ran into this on a view that I'd configured to use a single "Taxonomy terms associated with this node" relationship that includes 3 vocabularies with each of those vocabularies as an exposed "Taxonomy Term Name" filter. When I split this out to create a separate relationship per vocabulary, the view started working.

john bickar’s picture

I ran into this issue (the Notice: Trying to get property of non-object in views_many_to_one_helper->add_table() (line 825 of views/includes/handlers.inc) error) with a View that had a "Content: Taxonomy terms on node" Relationship and a "Taxonomy term: Term" Exposed Filter.

I was able to work around this by doing the following:

  1. Remove the "Content: Taxonomy terms on node" Relationship
  2. Remove the "Taxonomy term: Term" Exposed Filter
  3. Add either a "Content: Has taxonomy terms" or a "Content: Has taxonomy terms (with depth)" Exposed Filter
sill’s picture

#46 worked for me. Thanks John!

kscheirer’s picture

#46 fixed my issue as well, thanks!

mcdoolz’s picture

Currently doing this with Files as opposed to Content (nodes).

Using Entity Reference on File entity referencing Taxonomy.

Using Entity Reference relationship (bridge to entity that is referenced by File, in this case, Taxonomy Term).

Filter on ER throws error as #46 if set to 'Reduce duplicates' (server 500).