Taxonomy:Term filter values suddenly disappeared, view still takes them into account

pawshaker - April 9, 2008 - 20:36
Project:Views
Version:5.x-1.6
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:duplicate
Description

Since yesterday, the values for the filter "Taxonomy:Term" mysteriously disappeared. I guess it has to do with i18n.

eg

What I want: I want to filter on the terms Dog, Chien and Hund. When I use the "Taxonomy:Term for Animaltype" filter, the multilanguals terms were shown correctly, but views doesn't seem to use them (either ignoring or not showing the view at all or behaving unpredictable).
What I did: For that reason, I started using "Taxonomy:Term", which gives a long list of all categories, but always seemed to work.
The current problem: Yesterday, all values for "Taxonomy:Term" disappeared and only an empty field can be selected.

I have no clue what happened. The problem arised on the production site and is not present in development.

Thanks for all suggestions!

#1

catch - April 10, 2008 - 09:38
Project:Views» Localizer
Version:5.x-1.6» 5.x-3.x-dev

Moving to localizer, hope this is the right queue, but sounds like not a views bug.

#2

pawshaker - April 10, 2008 - 19:14

I tend to get confused with the translation modules, but I use Locale and I18n, but not localizer as far as I know.

Attached is a screenshot of the problem: Taxonomy:Term filter in views is empty, whereas it should show all taxonomy terms in all languages.

AttachmentSize
taxonomy_term_empty.gif10.18 KB

#3

pawshaker - April 10, 2008 - 19:17
Project:Localizer» Internationalization
Version:5.x-3.x-dev» 5.x-2.1
Component:User interface» Module i18nviews

Moving this here, because if it doesn't belong to views, it's likely related to i18n. Hope this is correct.

#4

pawshaker - April 11, 2008 - 12:20
Project:Internationalization» Taxonomy image
Version:5.x-2.1» 5.x-1.0-beta1
Component:Module i18nviews» Miscellaneous

Based on feedback in the forums at http://drupal.org/node/161863 , I'm moving this to Taxonomy Image. I use 5.x-1.0-beta1 with a patch that makes it easier to attach images.

#5

NancyDru - April 11, 2008 - 13:38

Two things to start with: please upgrade to the latest release; then read the other issue related to this (http://drupal.org/node/239621) for some code to remove.

#6

pawshaker - April 11, 2008 - 19:37

I tried the upgrade in my test environment and several long sql errors appeared. I was wondering if it's actually possible to do this upgrade when using version 5.x-1.0-beta1 with this patch: http://drupal.org/node/197369#5 . Thanks already for all help, I'm happy to see that there's an actual known cause for this empty Taxonomy:All terms behavior.

#7

NancyDru - April 12, 2008 - 01:34
Status:active» active (needs more info)

I don't think you should use that patch. What kinds of SQL errors do you get? That's something that definitely needs to be addressed. The -dev version should have all the SQL errors that I know about fixed. The Views problem hasn't been fixed yet because I'm waiting on someone who's more expert than I.

#8

pawshaker - April 12, 2008 - 14:19

I've started all over to ensure to have an exact copy of my production site.

1. I disabled and uninstalled Taxonomy Image 5.x-1.0-beta1
2. I installed the latest version of Taxonomy Image
3. I removed the following code from the Taxonomy Image module:
$tables['term_node'] = array(
'name' => 'term_node',
'join' => array(
'left' => array(
'table' => 'node',
'field' => 'nid'
),
'right' => array(
'field' => 'nid'
)
),
);

Result: the filter "Taxonomy:All Terms" still wasn't there and only the white empty box was shown. The views that are using this filter (every single one on my site), still work correctly. However, it's not possible to change them because you are prompted to give a value.

After reinserting the code above, the Taxonomy:All terms filters is not available anymore in the dropdown and I find the following errors in the logs:

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 'IN ('37','140','35')) ORDER BY node_counter_totalcount ASC, node_created_create' at line 1 query: SELECT node.nid, node_counter.totalcount AS node_counter_totalcount, node.created AS node_created_created, node_data_field_photo.field_photo_fid AS node_data_field_photo_field_photo_fid, node_data_field_photo.field_photo_title AS node_data_field_photo_field_photo_title, node_data_field_photo.field_photo_alt AS node_data_field_photo_field_photo_alt, node.title AS node_title, node.changed AS node_changed FROM drupalnode node LEFT JOIN drupalnode_counter node_counter ON node.nid = node_counter.nid LEFT JOIN drupalcontent_field_photo node_data_field_photo ON node.vid = node_data_field_photo.vid WHERE (node.status = '1') AND (node.type IN ('ctrescuepets')) AND (.tid IN ('37','140','35')) ORDER BY node_counter_totalcount ASC, node_created_created DESC LIMIT 0, 30 in /var/www/test.pets.be/includes/database.mysql.inc on line 172.

Note: the '37','140','35' are the translated term ids (eg Car, Auto, Voiture)

And

Invalid argument supplied for foreach() in /var/www/test.pets.be/includes/form.inc on line 948.

The impact of this issue is quite high on a multilingual site that uses views with nodes in different languages. These can only be build via Taxonomy:All Terms.

#9

NancyDru - April 12, 2008 - 14:22

Drat - time to punt.

#10

NancyDru - April 12, 2008 - 14:27
Status:active (needs more info)» duplicate

First, I guess we need to consolidate these issues (http://drupal.org/node/239621) so we can keep the dialog consistent. I've already linked to this one from that one. I'm going to mark this one "duplicate"; let's move the discussion over there.

#11

NancyDru - April 12, 2008 - 16:43
Project:Taxonomy image» Views
Version:5.x-1.0-beta1» 5.x-1.6
Component:Miscellaneous» Code
Status:duplicate» active

pawshaker reports that this occurs even with Taxonomy Image disabled. IMO, the focus on localization here is a rabbit chase. The problem is that "Taxonomy:All Terms" is unavailable for filtering. Moving back to Views.

#12

JBChristy - April 14, 2008 - 22:06

I'm seeing this same error, a missing table name in the AND (.tid IN (<list>)) clause, in many views with the 'Taxonomy: Terms for <custom type>' filter. I've opened a separate issue, http://drupal.org/node/246654, for the SQL error.

#13

pawshaker - April 16, 2008 - 20:26

I would like to report that on my site, the issue is solved. It's unclear why the Taxonomy:Terms filter disappeared or why it came back. (note: In the past few days, I had other stuff disappearing on the site, especially php code to show blocks. It's probably not related at all.) If I ever discover why this happened, I will post it here. Thanks to those who provided help.

#14

NancyDru - April 16, 2008 - 20:29

@pawshaker - this is the kind of thing that is usually associated with caching.

#15

pawshaker - April 17, 2008 - 05:50

Thanks Nancy. I emptied the view cache after every change, but that did not solve the problem immediately. But emptying views cache is definitely one of the key learnings for me.

#16

omnyx - April 27, 2008 - 23:54

Hm, i don't know if this is related but, all of a sudden, in my view when i go to filters I have a category term missing!
I have two terms for 'Column' vocabulary.

When I pick the filter
Taxonomy: Terms for Column I see: '-none selected-', and only one of the two terms (like the other one disappeared)

however, when I pick a more general filter

Taxonomy: Term then I see both of the terms.

Where in database can I see what the problem is?
This is SO weird :)

P.S. clear Views cache didn't help.

#17

NancyDru - April 28, 2008 - 03:35

@omnyx: I would suggest that you open this against Views. It may very well be related to the issue mentioned above.

#18

omnyx - April 28, 2008 - 10:16

just did - here's the related issue http://drupal.org/node/252114

#19

bander2 - May 14, 2008 - 15:17

This is happening to me too. For me it is always the first term that goes missing.

#20

NancyDru - May 14, 2008 - 19:37

Please join omnyx's issue on Views.

#21

sun - September 20, 2008 - 20:46
Status:active» duplicate

Marking as duplicate of #272289: Views 1.7 pre-req #2: Write new vocabulary fetcher

 
 

Drupal is a registered trademark of Dries Buytaert.