Upgrade of Textsize busted multisite install

mgifford - March 12, 2009 - 14:56
Project:Text Size
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

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')); 
}

AttachmentSize
textsize_check.patch491 bytes

#1

Christian Zwahlen - March 13, 2009 - 10:52
Status:active» fixed

Thanks. Fixed in the 6.x-1.x-dev version.

#2

mgifford - March 13, 2009 - 13:03

Excellent.. Glad this little module is maintained..

#3

System Message - March 27, 2009 - 13:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

#4

dkruglyak - May 26, 2009 - 06:50
Version:6.x-1.1» 6.x-1.x-dev
Status:closed» needs review

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

dkruglyak - May 28, 2009 - 01:00

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

mrfelton - September 17, 2009 - 08:28

the fix at #4 works here also.

#7

Christian Zwahlen - September 17, 2009 - 17:33
Status:needs review» fixed

Done.

#8

System Message - October 1, 2009 - 17:40
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.