Missing taxonomy terms in filters

cmillet1 - December 10, 2007 - 22:20
Project:Views
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

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.

#1

pagaille - December 12, 2007 - 03:25

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).

#2

jsenich - December 13, 2007 - 16:59

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.

#3

jsenich - December 13, 2007 - 17:40
Status:active» needs review

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 '':

AttachmentSize
views_taxonomy.inc_.patch 652 bytes

#4

WiseTeck - December 19, 2007 - 14:51

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

#5

westwesterson - December 31, 2007 - 11:20
Status:needs review» reviewed & tested by the community

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

#6

ju.ri - January 4, 2008 - 12:50

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.

#7

vthirteen - January 6, 2008 - 09:56

subscribe

#8

catch - January 11, 2008 - 11:28
Component:User interface» Code

#9

catch - January 11, 2008 - 14:49

#10

isaac77 - January 11, 2008 - 18:00

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

#11

cmillet1 - January 11, 2008 - 21:03

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

#12

xav - January 12, 2008 - 15:02

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

Thanks !

#13

nektir - January 14, 2008 - 16:30

subscribe

#14

subru77 - January 14, 2008 - 20:51

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

#15

catch - January 14, 2008 - 21:04

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.

#16

catch - January 15, 2008 - 16:48

#17

matt_harrold - January 16, 2008 - 05:41

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.

#18

jsenich - January 22, 2008 - 19:42

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?

#19

jsenich - January 22, 2008 - 21:34
Status:reviewed & tested by the community» needs work

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

#20

merlinofchaos - January 22, 2008 - 21:50

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.

#21

jimbop - January 23, 2008 - 04:22

subscribe

#22

nschelly - January 23, 2008 - 19:24

subscribe
-N

#23

ram0135 - January 24, 2008 - 00:43

Subscribing :)

#24

Summit - January 26, 2008 - 00:04

Subscribing.
greetings,
Martijn

#25

idcm - January 26, 2008 - 01:47

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

#26

jimbop - January 26, 2008 - 02:01

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

#27

shawnpetriw - January 28, 2008 - 07:03

"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.

#28

xav - January 28, 2008 - 10:49

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 !

#29

catch - January 28, 2008 - 10:57
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.

#30

merlinofchaos - January 28, 2008 - 16:26

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.

#31

jt_jones - January 29, 2008 - 19:25

subscribing

#32

Dimegga - January 31, 2008 - 19:49

subscribing...

#33

thund3rbox - February 1, 2008 - 19:55

subscribe

#34

mbria - February 4, 2008 - 02:14
Title:Missing taxonomy terms in filters» subscribe

subscribe

#35

mbria - February 4, 2008 - 02:14
Title:subscribe» Missing taxonomy terms in filters

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

#36

pyg77 - February 4, 2008 - 10:25

subscribing

#37

syoumans - February 4, 2008 - 16:20

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)

#38

merlinofchaos - February 4, 2008 - 16:31

There is no "None selected" filter.

#39

leo.ruffini - February 5, 2008 - 13:09

subscribe

#40

seanburlington - February 7, 2008 - 15:10

me too

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

#41

gsquirrel - February 8, 2008 - 12:05

subscribe

#42

frost - February 11, 2008 - 13:50

subscribing

#43

oskar_calvo - February 13, 2008 - 12:10

I get it works with the patch.
Thanks.
oskar

#44

rooey - February 13, 2008 - 12:22

patch fixed me up good.

#45

vanvemden - February 18, 2008 - 05:28

subscribing. thanks for the patch.

#46

Rollie - February 18, 2008 - 14:46

subscribing

#47

freakalis - February 20, 2008 - 16:32

subscribing, please fix this :)

#48

dww - February 26, 2008 - 00:55
Status:needs review» reviewed & tested by the community

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.

AttachmentSize
views_taxonomy_missing_term_in_filter.patch 708 bytes

#49

dww - February 26, 2008 - 01:00
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...

#50

abe - March 1, 2008 - 01:50

subscribing

#51

momper - March 2, 2008 - 22:24

subscribing

#52

crandell - March 3, 2008 - 05:35

subscribing

#53

bundes - March 3, 2008 - 18:28

subscribe

#54

philray - March 6, 2008 - 14:37

subscribing.

#55

merlinofchaos - March 7, 2008 - 05:22

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.

#56

WorldFallz - July 15, 2009 - 15:48
Status:needs work» fixed

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

#57

System Message - July 29, 2009 - 15:50
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.