I've created several views which have multiple taxonomy filters of the "Taxonomy: Terms for x" type. Recently I noticed that the first term in each vocabulary is always missing from the list of terms in the filter. I double-checked in the category admin area, and the terms are there, but in every case it's the first term in the vocabulary that's missing from the views filter.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pagaille’s picture

I just noticed the same issue. I have two filters, one for Years (2007-2010) and one for States (AK-WY). But the year filter starts with 2008 and the state filter starts with AL. There's no way to select 07 or AK (first terms in each vocab).

jsenich’s picture

I just ran into this as well after upgrading Drupal to 5.4/5.5. I think it has something to do with the changes to the taxonomy module.

jsenich’s picture

Status: Active » Needs review
FileSize
652 bytes

This fixed it for me. It looks like in the changes to the taxonomy module from 5.3 to 5.4 they changed the array key for the blank option from 0 to '':

WiseTeck’s picture

This patch also works for me. The change in taxonomy that make this patch required is from http://drupal.org/node/180109

westwesterson’s picture

Status: Needs review » Reviewed & tested by the community

i had the same problem, this patch did the trick. Thanks

ju.ri’s picture

there is another serious problem resulting from http://drupal.org/node/180109
exposed filters are shown as "all", but results are filtered as "please select", resulting in no search results at all:
http://drupal.org/node/180109#comment-665927
this patch solves it: http://drupal.org/node/180109#comment-667864
please include it in an update.

vthirteen’s picture

subscribe

catch’s picture

Component: User interface » Code
catch’s picture

isaac77’s picture

subscribing. (just ran into the same issue. creating a dummy term and giving it a weight of -10 as a temporary workaround.)

cmillet1’s picture

The patch worked for me. Thanks to everyone for their quick responses here.

xav’s picture

Worked here too (I had to clear the views cache though).

Thanks !

hillaryneaf’s picture

subscribe

shariharan’s picture

Upgraded to 5.6 and the taxonomy is still missing first term. Do we have to wait till next release ?

catch’s picture

subru: once this goes in, it'll be in either views 5.x-1.x-dev or eventually 5.x-1.7 - a drupal core security/bugfix release broke views, subsequent releases won't unbreak it.

If you'd like to test the patch yourself, go to http://drupal.org/patch to get started.

catch’s picture

matt_harrold’s picture

My apologies for the duplicate issue (I posted http://drupal.org/node/210249). I searched but came up short.

It's great news that there is already a patch for this, many thanks clever developers.

The exposed filters now work as they should, however, on the View editing form, the problem still appears to be there (missing the first term). It would only affect people who need to filter the view by the first term, but it is still a tiny bug hidden somewhere.

jsenich’s picture

I'm not having the issue on the View editing form after applying the patch. Have you tried clearing the cache after applying the patch?

jsenich’s picture

Status: Reviewed & tested by the community » Needs work

merlinofchaos says that this patch masks a deeper problem so it will not be used.

merlinofchaos’s picture

No, it masks a deeper problem, not creates.

Please feel free to use this patch if it gets your site working. Just saying that I won't be committing it directly until I find the time to fix the underlying problem which is that taxonomy terms shouldn't be stored in the views cache *at all* and I'm an idiot and committed a patch that did without thinking about the ramifications.

jimbop’s picture

subscribe

nschelly’s picture

subscribe
-N

ram0135’s picture

Subscribing :)

Summit’s picture

Subscribing.
greetings,
Martijn

idcm’s picture

glad to hear it isn't just me. I tried the patch and it didn't work. However, I don't have access to my database right now so can't clear my cache - ggrrrrr. myphpadmin is not installed yet (out of my control) and the dba module isn't quite ready for D5.

forgive my ignorance about the "subscribing" posts. Does that mean you will notify these folks when it is fixed? Count me in if so.

thanks
c

jimbop’s picture

When you contribute to a topic (even by typing 'subscribe') you can track the issue in your drupal user account.

shawnpetriw’s picture

"When you contribute to a topic (even by typing 'subscribe') you can track the issue in your drupal user account."

I never knew that - count me as subscribed (and one who is creating a dummy term to reside at the top!)

PS - my pull-down menus now say - None Selected - as the default, "replacing" the first term (kicking it out of it's place?). It always used to say as default, with my list of terms below that.

Also, I only noticed this after upgrading to 5.6.

Finally the terms render properly at the node/add level, but don't show up in views correctly, in view or in edit view.

xav’s picture

idcm: you don't have to have access to the database to clear the cache. There's a button somewhere in the administration pages (in views I think), you just have to click it and voila !

catch’s picture

Status: Needs work » Needs review

By the way just because there are more fundamental issues doesn't mean this patch won't fix this one. You'd be better off applying the patch on your sites (which is a very tiny fix) than making dummy terms etc.

merlinofchaos’s picture

Yes, I agree with catch. I am not going to commit this patch into the Views codebase, but if you are being hit by this problem by all means apply this patch.

jtjones23’s picture

subscribing

Dimegga’s picture

subscribing...

patrickfgoddard’s picture

subscribe

mbria’s picture

Title: Missing taxonomy terms in filters » subscribe

subscribe

mbria’s picture

Title: subscribe » Missing taxonomy terms in filters

sorry... I changed the title. :-(
rolling back to "Missing taxonomy...."

pyg77’s picture

subscribing

syoumans’s picture

This bug seems like a larger issue that what is being handled by the patch. I have an OPTIONAL taxonomy, and on the filter list, the terms show up as:

<All>
- None selected - 
Term2
Term3
...
Term6

Term 1 is missing from this list.

When I apply the above patch, Term1 appears in the list, but the "- None selected -" item disappears from the list.

So right now I've commented out the unset() in (!$vocabulary->required()){ unset.... } and all the items seem to show up correctly. (Note that the none selected filter doesn't seem to be working for me, but I'm assuming that that is a separate issue.)

Did anyone else notice this?
(Drupal 5.6 / Views 5.x-1.6)

merlinofchaos’s picture

There is no "None selected" filter.

leo.ruffini’s picture

subscribe

seanburlington’s picture

me too

applied patch, cleared cache - now it works :-)

gsquirrel’s picture

subscribe

frost’s picture

subscribing

oskar_calvo’s picture

I get it works with the patch.
Thanks.
oskar

rooey’s picture

patch fixed me up good.

vanvemden’s picture

subscribing. thanks for the patch.

Rollie’s picture

subscribing

freakalis’s picture

subscribing, please fix this :)

dww’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
708 bytes

Just ran into this myself. Other than the DOS line endings in patch #3, this solves the problem, and is clearly needed. Re-rolled to be a clean patch, and from the root of the views directory. Otherwise, it's the same (trivial) fix, so I'm setting this RTBC.

dww’s picture

Status: Reviewed & tested by the community » Needs work

Sorry, whoops, I missed #20 above: http://drupal.org/node/199675#comment-701781
Anyway, this works around the problem for now. I'll see if I can spare any cycles on the underlying problem...

abe’s picture

subscribing

momper’s picture

subscribing

crandell’s picture

subscribing

bundes’s picture

subscribe

philray’s picture

subscribing.

merlinofchaos’s picture

please stop subscribing to this issue. This issue has 30 subscribes which have now buried the patch.

there is no more to this issue.

use the patch.

WorldFallz’s picture

Status: Needs work » Fixed

At some point this was fixed-- current dev is now correct. Closing and locking again.

Status: Fixed » Closed (fixed)

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