Closed (fixed)
Project:
Taxonomy Limit
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
14 Feb 2008 at 16:58 UTC
Updated:
16 Jan 2012 at 22:00 UTC
I don't know if this should be posted here or under Taxonomy Super Select -- let me know if I should move it.
I'm trying to use Taxonomy Limit with Taxonomy Super Select, since I would like to use checkboxes instead of a multi-select list, and I would like to limit the number of categories selected. However, when I try to submit an event with Taxonomy Super Select enabled, Taxonomy Limit insists I have too many categories selected, regardless of how many have been checked.
Taxonomy Limit works fine when Taxonomy Super Select is disabled, and vice versa.
Comments
Comment #1
alfaguru commentedI have a fix for this issue which I've performed some very basic testing on. The problem arises because when TSS is used the array of values tested includes the unchecked terms (values set to zero) as well as checked ones. This module currently counts the total number of entries rather than only non-zero ones.
Fortunately there is a simple fix, to pass the array through the array_filter function before counting the entries. When this function is used without a callback it removes all entries equal to FALSE, which in this case are the ones for the unchecked terms. So changing line 98 of the module from:
to:
does the trick. (I would supply this as a patch except that my setup doesn't make it very easy to do so. )
Comment #2
mvcThis particular bug is now fixed in the Drupal 6 release.
There are a bewildering number of taxonomy related modules available, many of which conflict with each other. It may not always be possible to change taxonomy limit to work with them all, especially in combination. However, on the grounds that being more lenient with user input was better I have applied a similar patch to what alfaguru suggested.
Comment #4
natukI am afraid this is not working for me in version 6.x-0.1.
I believe these are the lines responsible:
I am not quite sure what is happening here, but the last one does not seem right.
Comment #5
detot commenteddoesn't work for me either, any solution?
Comment #6
rabielmo commentedI was able to go around the situation in the _taxonomy_limit_validate_max_terms() function in taxonomy_limit.module, by modifying the lines pointed out by naku in #4 above. Here is the array that actually contains the tags being tested:
Let me know if this works for anyone else.
Comment #7
valariems commentedThank you, rabielmo (#6). The patch worked for me.
Comment #8
rickdrup commentedPatch at #6 worked perfectly for me also. I'm running Taxonomy Limit, Taxonomy Super Select & Taxonomy Role on Drupal 6. Thanks.
Comment #9
mvcI've (finally) tagged a stable version for D6, which includes the patch from #6. Thanks.
Comment #10
mvc