Closed (fixed)
Project:
Files undo remove
Version:
7.x-1.0
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Dec 2011 at 10:10 UTC
Updated:
28 Dec 2011 at 12:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
labor b commentedI did some further testing on a clean install and managed to fix this issue.
It works when I put drupal_add_js into a hook_init or hook_form_alter function.
I'm not that familiar with Drupal.behaviors, but it seems like the function has to be present before adding new files.
Comment #2
labor b commentedDon't think my solution is best practice, but in case someone needs a quick fix:
Just attach this to files_undo_remove.module.
Comment #3
swentel commentedHere's a patch. I've moved the css and js file to the hook_init(), because this would also fail on an existing node edit which has no files attached yet.
While hook_init() is kind of annoying in a way, there's no other place (well, maybe attach_form or so, but still). With css and js aggregation on, this is not really a big penalty. I'll put out a new release soon!