Closed (fixed)
Project:
Active Tags
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
26 Jul 2011 at 05:26 UTC
Updated:
9 Aug 2024 at 13:22 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
nagiek commentedSeconded.
Comment #2
mattwmc commentedIf the first post is describing how it's done with Tumblr or YouTube, I'm all for it.
Otherwise, I gotta pass.
Thanks.
Comment #3
attila.fekete commentedHi! Try this patch. Pressing 'Add' is optional. (Also includes fix for http://drupal.org/node/1257268).
Comment #4
attila.fekete commentedPatch in #3 not working, fixed.
Comment #5
Georgique commentedLet's use this issue for fixing both problems (I've marked http://drupal.org/node/1257268 as a duplicate).
Attaching improved #4 patch:
1) JS code a bit improved to be more quick
2) Validation fixed for cases when active tags widget was moved into some container (fieldset, etc.)
Please, review.
Comment #6
Georgique commentedImproved retrieving values from $form_state['values'].
Comment #7
Georgique commentedRemoved "dirty" js code which were adding tags on submit, improved retrieving values from $form_state
Comment #8
k.dani commentedI would like to use the Active Tags with Profile 2. I tried all of the patches above, but I always got errors during the validation:
Comment #9
k.dani commentedI created a new patch based on Georgique's latest patch. Now it works properly on profiles as well.
Comment #10
Georgique commented@k.dani Yes, your patch is better, but was not working on my project, so I fixed and improved it. Please, review and test
Comment #11
loze commentedthe patch in #10 works for me. Thanks!
Comment #12
pfrenssenI'm trying to make sense of the history of these patches. I attached the missing interdiffs starting from patch #7. It seems that the patch in #9 was a regression in terms of comment quality. This has been fixed again in #10.
Comment #13
pfrenssenReview:
Comment #14
pfrenssenThis doesn't take the widget settings regarding splitting on comma into account.
Use $form_state['values'] to retrieve the values, rather than relying on the form values.
2 lines higher it is already determined that this is not empty.
Don't set values in $form_state['complete form'], put them in $form_state['values'] instead.
Is it really needed to call this validation function twice? It has already been called before.
Don't set values in $form_state['complete form'], put them in $form_state['values'] instead.
Comment #15
pfrenssenI addressed my remarks. I was mistaken about using $form_state['values'], apparently when using element validation you have to use $form_state['complete form'] instead. Also the splitting on commas is not done in js but in the validate handler by wrapping the tag with quotes.
This is a simplified version of the patch that retains full functionality, and also supports the 'csv' option.
While testing the patch I was encountering some notices, but these are due to a core issue: #1525176: Using array_diff_assoc() for multilevel arrays in DrupalDefaultEntityController->cacheGet().
Comment #16
pfrenssenBack to needs review.
Comment #17
pfrenssenUpdated the theme function, the tags are no longer unecessarily presaved on form validation, so their tids may or may not be present.
Comment #18
isolate commented#17 looks good.
Comment #19
DeFr commented#17 doesn't look all that good on the error validation part.
Re-theming should not happen in a validate handler. Instead, there should be a '#pre_render' callback handling the theming all the time, making it all more consistent.
I really think those 3 issues should be split instead of meshed into one, but, given the state we're in, maybe we should just try to get things rolling. (Must say there's a bunch of code that makes it really tempting to clean it all up though)
Comment #20
DeFr commentedThis is what it'd look like with the #pre_render call.
Haven't really looked at the rest of the patch yet, but there's some other things that seems problematic ; at least the terms = term.split(','); is badly breaking the tag additions for terms that includes a , in them and are selected through the autocomplete functionnality. In that case you get a 'Foo, Bar' in the textfield, but clicking the Add button leads to the creation of two terms. To be honest, I don't understand at all why that was added here: tag splitting on commas is already handled in addTerms if needed, addTerm always get a single term. I'd completely remove that change.
Comment #21
Anonymous (not verified) commentedThe patch in #20 solved my problems (primarily, the widget breaking and losing newly added values when there was a validation error).
Comment #22
michelleThe patch in #20 had one hunk fail because the line being replaced has had a check_plain added to it in the latest code. I've rerolled the patch against current 7.x-2.x.
I've left this at "needs work" because that's where it was with the previous patch and all I did was reroll it so it applies. I didn't address any of the issues noted.
Comment #23
mahyarsbt commentedThank you for your continued interest in the Active Tags module.
We are excited to announce that the issue you raised has been addressed in the revitalized Active Tags version 1.0.0. This update supports Drupal 9, 10, and 11 and brings a modern interface along with a range of new features to enhance your Drupal tagging experience, including:
This is just a glimpse of the new capabilities. We encourage you to explore these new features by downloading the latest version. For a full list of features and more details, please visit the Active Tags project page.
Comment #24
mahyarsbt commentedWith the release of Active Tags 1.0.0, we believe this issue has been fully resolved. We invite you to explore the latest version and share any feedback you have.
Thank you for your continued support and contributions to the Drupal community. Together, we can keep improving Active Tags!
Visit the Active Tags project page to stay updated and provide feedback.