Closed (duplicate)
Project:
Active Tags
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Aug 2011 at 09:58 UTC
Updated:
22 Apr 2013 at 10:07 UTC
Jump to comment: Most recent file
Comments
Comment #1
synetic commentedI investigated the issue and experienced that after a form submit with validation errors the javascript and css were not included in the page html.
In the function active_tags_field_widget_form() there were 2 drupal_add_js calls and 1 drupal_add_css call. Because the form gets cached these were not run anymore on form validation errors.
I updated the code so the javascript and css files are included with the #attached form attribute. see:
http://api.drupal.org/api/drupal/developer--topics--forms_api_reference....
This patch updates the module file.
Comment #2
coakeson commentedYour patch works great to get the javascript and css onto the validation pages.
The problem still exists where on a validation error the terms are not showing in the field_terms markup since nothing exists in the $items variable in active_tags_field_widget_form. The items are being saved in the hidden terms field and in the term_entry field if not pressing the add button, but nothing is coming through to $items. Any ideas about what could be happening?
Comment #3
boobaaAttached is a reroll of the patch in #1.
$form['#attached']['css']is an array which may have other entries in it. Without this rerolled patch this array is simply overwritten, which is obviously wrong (think other modules adding JS and CSS stuff via the same facility). This rerolled patch is about adding active_tags' entries to this array instead of overwriting the whole array.OTOH, the problem #2 mentions is not solved by this, either. We have even tried
$form_state['rebuild'] = TRUE, without success. Another idea was messing up $_SESSION with the submitted data in a custom validate callback, reuse that here, and cleaning up the mess in a custom submit callback; but that's just another way to have PITA.Comment #4
BrockBoland commentedBoobaa: the attachment is missing. Any chance you've still got it laying around?
Comment #5
boobaaUh-oh, sorry, looks like I've lost that patch; I couldn't even found the project I was giving this module a try. Sorry.
Comment #6
succinct commentedI've run into this issue too. Anyone have a solution? A major bug open for a year seems strange...
Comment #7
attila.fekete commentedHi, after a couple of hours I managed to make it work.
Comment #8
jahukka commentedAttilas patch gives following errors:
Undefined index: field_article_tags funktiossa active_tags_taxonomy_autocomplete_validate() LINE: 93
Invalid argument supplied for foreach() funktiossa active_tags_taxonomy_autocomplete_validate() LINE: 93
Comment #9
attila.fekete commentedAccidentally I left the hardcoded field names in the patch, try the 2nd patch posted here: Process the information in the textbox when user presses submits as valid tags to add
It includes this fix as well.
Comment #10
jahukka commentedSeems to work. Thanks!
Comment #11
Georgique commentedLet's close this as duplicate and work with http://drupal.org/node/1229532 since good patches are posted there.