Posted by mgifford on March 12, 2009 at 2:56pm
Jump to:
| Project: | Text Size |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Just upgraded textsize and got this error:
Fatal error: Call to undefined function jquery_plugin_add() in textsize/textsize.module on line 326
It's fine to add in the requirement for this plugin module, but it's important to check for it first, this would be better for the last line:
if (function_exists('jquery_plugin_add')) {
jquery_plugin_add('cookie');
} else {
drupal_set_message(t('Drupal\'s jQuery Plugin Module Required for textsize functionality'));
}| Attachment | Size |
|---|---|
| textsize_check.patch | 491 bytes |
Comments
#1
Thanks. Fixed in the 6.x-1.x-dev version.
#2
Excellent.. Glad this little module is maintained..
#3
Automatically closed -- issue fixed for 2 weeks with no activity.
#4
Oops, wrong solution!
The fatal error (or "Required" message) happens because textsize_jq_plugin() is called when the module is loaded, which is BEFORE other modules may be loaded, including jquery_plugin. Perhaps not everyone can reproduce this since the load order of file depends on their file system structure.
The solution is to move the following chunk of code, called at the end of textsize.module inside textsize_init() hook:
textsize_print_html();textsize_print_js_css();
textsize_jq_plugin();
textsize_check();
The fix is tested and works. The same problem needs to be fixed in pagestyle.module.
#5
I should add that the problem is not with "multisite install" per se, even though I do run multiple sites.
Simply under certain filesystem structure (determining the module code loading order?) the module causes the bug.
#6
the fix at #4 works here also.
#7
Done.
#8
Automatically closed -- issue fixed for 2 weeks with no activity.