I'm using excellent JQuery upload widget on Drupal 6. Since there is no designated module for that widget (there is for D7, but not D6) I'm adding the necessary files using drupal_add_js
(via a helper module).
So the file upload works, but if I add the date pop up to a Drupal form, it causes the JQuery UI (activated by the date pop up) to break.
To be more specific it produces this error message:
"TypeError: $.widget.extend is not a function"
I've read some threads dealing with similar issues and tried to follow some of the suggestions given. As far as I can tell the problem is this:
- The JQuery file upload widget uses the
jquery.ui.widget.js
called from the/fileupload/js/
folder (usingdrupal_add_js
in a helper module) - If I add a date pop up field to a Drupal form the Jquery UI from
sites/all/libraries/jquery.ui/ui/ui.core.js
kicks in, which already containsjquery.ui.widget
causing the error
Now at this point I thought it would just make sense to remove my call to jquery.ui.widget.js
but the problem is that:
- Other
fileupload.js
depend on it, and: The D6 Jquery UI module adds
/sites/all/libraries/jquery.ui/ui/ui.core.js
AFTER all files included viadrupal_add_js
, and as a result breakingfileupload
as it lacks thejquery.ui.widget
support at the time it’s read (and producing the following errors:TypeError: $.widget is not a function TypeError: $(...).fileupload is not a function )
I tried setting the weight of my custom module (by editing the system table in the database) to a high value but still, the Jquery UI files are added AFTER all drupal_add_js
files.
If anyone out there could provide some further insight on how to approach this issue that would really help.