I have a two taxonomy term ref fields on users, and a view with the following:
- base: user
- relationship 1: first taxonomy field, multi-valued
- relationship 2: second taxo field, multi-valued
- filter 1: taxonomy on the first relationship, single-valued
- filter 2: taxonomy on the second relationship, single-valued
If I pick an option from just one filter, then everything works fine.
If I pick an option from each filter, the page load hangs.
Here's how far I've got with debugging this...
The site log has this:
Notice: Trying to get property of non-object in views_many_to_one_helper->add_table() (line 710 of /Users/joachim/Sites/rbs-drupal-p3/sites/all/modules/views/includes/handlers.inc).
This is within the views_many_to_one_helper object, in add_table(). It's trying to work with joins but it doesn't have what it needs.
I think I've traced the problem further back. In views_many_to_one_helper->ensure_my_table(), we have this logic:
if (empty($this->handler->options['add_table']) && empty($this->handler->view->many_to_one_tables[$field])) {
For the first filter, this check passes because the many_to_one_tables array is empty.
The second time we come here, the value of $field is the same. I can't tell if that's part of the bug too, or if that's normal!
At any rate, having failed that condition, we go to the else part and the first statement there is:
$join = $this->get_join();
which returns NULL. Again, I suspect this is a bug, but the code in get_join() appears to allow for the possibility of returning NULL so I am not sure. What I do know is that from here, we have a $join object that doesn't start out with a full set of keys, and so that is that I think causes the error message in add_table(), which is called further along.
Comment | File | Size | Author |
---|---|---|---|
#5 | term_filter_problem.txt | 9.32 KB | zabelc |
#1 | 1156822-fix-multiple-tax-on-relationships.patch | 1.58 KB | merlinofchaos |
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedThis patch seems to fix this for me:
Comment #2
joachim CreditAttribution: joachim commentedYup, patch fixes the problem for me too.
Thanks! :D
Comment #3
dawehnerCommited to 7.x-3.x and 6.x-3.x, should this be backported to 6.x-2.x as well?
Comment #4
joachim CreditAttribution: joachim commentedI've not seen the problem on 6.x-2.x -- I've not looked, but I'm sure I've done multi-taxonomy filters before :)
Comment #5
zabelc CreditAttribution: zabelc commentedI'm not sure if it's exactly the same issue, but I'm seeing similar behavior with the 7.x-3.x-dev built on 2011-07-13. I've tried to apply the patch, but get a message that it's already been applied.
In my case I currently have a working Term view with the filter "Taxonomy vocabulary: Machine name (= Club Role)".
When I attempt to add a new filter "Taxonomy term: Term (<> Member)" it hangs indefinitely, and I've gotten an error in views_many_to_one_helper (which I'm having trouble duplicating). It also fails if I set the filter to "Taxonomy term: Term (= Member)". FWIW, not setting a value for that filter causes no problems.
I've attached the troubled view - with the problem block commented out (note that I'm using my own custom view style, but the error can be replicated with an unformatted list style).
Comment #6
MegaChriz CreditAttribution: MegaChriz commentedI noticed this problem too (the same as zabelc reported) in Views 7.x-3.0-rc3:
Comment #7
MegaChriz CreditAttribution: MegaChriz commentedThe error zabelc and I got is probably related to #1121926: Contextual filter "Taxonomy term: Name" - Several errors
Comment #8
javier1968 CreditAttribution: javier1968 commentedHello, I have a similar issue that is flooding my log messages
Notice: Trying to get property of non-object in views_many_to_one_helper->add_table()
LOCATION http://test.lwec.org.uk/admin/structure/views/view/related_stories/previ...
REFERRER http://test.lwec.org.uk/admin/structure/views/view/related_stories/edit
The interesting thing is that the view does not exist on the site as it was deleted, still ajax seems to be hanging.
I can't edit any nodes neither.
Cheers
Comment #9
Leeteq CreditAttribution: Leeteq commented