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!

CommentFileSizeAuthor
#2 taxonomy_term_empty.gif10.18 KBThePickwickProject

Comments

catch’s picture

Project: Views (for Drupal 7) » 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.

ThePickwickProject’s picture

StatusFileSize
new10.18 KB

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.

ThePickwickProject’s picture

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.

ThePickwickProject’s picture

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.

nancydru’s picture

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.

ThePickwickProject’s picture

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.

nancydru’s picture

Status: Active » Postponed (maintainer 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.

ThePickwickProject’s picture

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.

nancydru’s picture

Drat - time to punt.

nancydru’s picture

Status: Postponed (maintainer needs more info) » Closed (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.

nancydru’s picture

Project: Taxonomy Image » Views (for Drupal 7)
Version: 5.x-1.0-beta1 » 5.x-1.6
Component: Miscellaneous » Code
Status: Closed (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.

prfctns6@gmail.com’s picture

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.

ThePickwickProject’s picture

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.

nancydru’s picture

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

ThePickwickProject’s picture

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.

omnyx’s picture

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.

nancydru’s picture

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

omnyx’s picture

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

bander2’s picture

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

nancydru’s picture

Please join omnyx's issue on Views.

sun’s picture

Status: Active » Closed (duplicate)