Closed (fixed)
Project:
Taxonomy single tag
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
7 Sep 2011 at 22:22 UTC
Updated:
25 Sep 2013 at 15:31 UTC
Jump to comment: Most recent file
Comments
Comment #1
johnpitcairn commentedAck. And here I was hoping I could use this to allow users to select topics for an article and drag-rearrange those to indicate the relative importance of each topic. That's a pretty good use-case IMO.
@mikeker, are you working on this? It's assigned to you...
Comment #2
Niremizov commentedIf someone still needs functionality of saving (working) with multiple values by using this module, here is a small patch that fixes module's work. Rearranging items works too.
BTW: I was testing it with unlimited cardinality.
Comment #3
mikeker commentedMy apologies, this one fell off my radar. I'll review the patch in #2 in the next few days -- if I don't, please raise hell in this issue! :)
Again, sorry for the delays!
Comment #4
Niremizov commentedI have changed a bit previous patch, so it won't conflict with other modules (like content taxonomy, if support will be added #1548858)
Comment #5
arhak commented@#4
I'm not up to date with D7 fields API
but I guess it can't be that far from D6 CCK..
- there should be an API function to test wether a field is empty, since the definition of "empty" varies depending on the type of field and widget
- there should be as well, an API function to set the field to "empty" (without pushing a FALSE, rather letting module hooks react)
- ..otherwise, you'll find yourself inserting custom code for each crazy third party module
- also, the comment states "make it a string", but the code doesn't do that, those should be in correspondence
my two cents
Comment #6
Niremizov commentedOkey, after digging a bit it turned out, that we don't need check for field is empty or not... Because we are actually doing it before: line 88 (after using patch) taxonomy_single_tag.module
And default empty value is set before that if statement... So made some changes to patch in #2.
Comment #7
arhak commented@#6 and I guess that testing
if($tag)is safe in this case, because we are dealing with taxonomy (core's terms)and no other kind of fields
nevertheless, a well documented comment would improve readability
(why not using
empty)Comment #8
Niremizov commentedWell the same check is made inside taxonomy.module itself... so i just commented to @see taxonomy_field_is_empty()... Isn't it enough?
And actually we still can use empty function, for check input values like $element['#value']:
In our case this statement is safe too... So i'am confused a bit, about commenting...
Comment #9
SidneyGijzen commentedI applied patch from #6 successfully to the current 7.x-1.1 version. Thanks Niremizov!
Comment #10
opstao commentedPatch from #6 is working for me. I don't understand why, but without the patch, I was getting errors not only with the new field where the "Single tag autocomplete text field" widget was applied, but also with other fields allowing multiple-item adding – even though they were neither autocomplete nor based on taxonomy terms.
Comment #11
drclaw commentedI also had some success with the patch from #6, however there were still some undefined index errors if ajax requests were made on the page with a single taxonomy tag field. An image field for example. Attached patch adds an extra check to make sure there's a weight value on the form input before. Additionally I removed a some commented out debugging statements and cleaned up a bit to match drupal's coding standards.
Comment #12
arhak commentedhand it over to the maintainer of this branch
mmm... its been a while since mikeker@#3 ...
Comment #13
mikeker commentedApologies for the wait... I've committed #11 to the 7.x branch.
Thank you for your work on this issue!
Comment #14
arhak commentedthanks mike
Comment #15
arhak commentedthanks mike