Closed (duplicate)
Project:
Drupal core
Version:
4.5.0
Component:
taxonomy.module
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
4 Nov 2004 at 12:45 UTC
Updated:
18 Jan 2005 at 20:57 UTC
Jump to comment: Most recent file
Comments
Comment #1
dries commentedThere appears to be a third and a fourth instance of '%%%s%%' in taxonomy.module. Do these need to be udpated as well?
Comment #2
Bèr Kessels commentedI found out why there waswildcard srach :).
When one assign one taxonomy to more nodes, it is saved as
nodename1, nodename2 in the table. a %%%s% will return subselects from that table field.
IMO that is bad and hackish code. I am looking into it, for a more robust solution.
For now postpone it :)
Bèr
Comment #3
killes@www.drop.org commentedhttp://drupal.org/node/6847
Comment #4
jhriggs commentedI don't necessarily think this should be closed as a dup to 6847, as that is taking a completely different approach that I am not sure is needed...at least in the short term. Why don't we just make this solution simple by using a delimiter between the entries. For example, instead of the types being stored as "blog,story,flexinode-1,foo", store it as "|blog|story|flexinode-1|foo". The query then looks for '%|flexinode-1|%' rather than '%flexinode-1%'. The latter, as Ber pointed out, will pick up flexinode-1, flexinode-10, flexinode-12345678, etc. The former will not. The only downside is that the delimiter character is no longer available in node type names.
Attached is a patch that does just this. If it is applied, we may need to alert maintainers of taxonomy-related modules that may be using the nodes field in the vocabulary table.
As a side note, I would like to do the same type of thing for role permissions which is also doing a similar (potentially flawed) LIKE to check for permissions.
Comment #5
jhriggs commentedNote that the patch includes the DB update in updates.inc which may need to be changed slightly if this were to get applied to 4.5.
Comment #6
Bèr Kessels commentedThe patch got lost during the move ot the servers. Attaching it again.
Comment #7
killes@www.drop.org commentedhttp://drupal.org/node/6847