Bug 6282 - Lazy loaded plugins are not adding their required data to the header
Lazy loaded plugins are not adding their required data to the header
Status: RESOLVED INVALID
Product: OJS
Classification: Unclassified
Component: Plug-ins
2.3.x
All All
: P3 normal
Assigned To: jerico
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-12-06 13:01 PST by Matthew Crider
Modified: 2010-12-13 14:14 PST (History)
2 users (show)

See Also:
Version Reported In:
Also Affects:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Crider 2010-12-06 13:01:18 PST
It seems that generic plugins that require data to be added to the header via their callback are not doing so when they are lazy loaded.  For instance, the rounded corners plugin will not add the needed css file, unless the lazy_load column in the DB is set to 0 (but if you're on the plugin management page, it will load!).  This was brought to my attention when testing a plugin James wrote, which is not in the versions table at all, so I assume the default action for a plugin is to lazy load.
Comment 1 Michael Felczak 2010-12-07 22:04:38 PST
Matt, can you please check if the fix for Bug 6279 resolves this?
Comment 2 Matthew Crider 2010-12-08 10:56:50 PST
Afraid not Michael..  At least not for the rounded corners plugin (it only loads on plugin management pages, which i just don't understand).  Again, if I set the lazy_load column for the roundedCorners plugin in the versions table to 0, it loads everywhere (and quick spin through the debugger shows that the RoundedCorners plugin's register function is only ever called if its lazy load option is 0).
Comment 3 jerico 2010-12-10 22:14:57 PST
Hi Matt, 

the plug-in management pages scan the file system to load all plug-ins so in that case the plug-in will be loaded independently of the lazy-load flag. That explains the differing behavior.

Now what is strange is that block plug-ins should load on every page as soon as they are enabled. If they don't load then something must be wrong in the database. I'll have a look at that to see whether I can reproduce it.

Florian
Comment 4 jerico 2010-12-11 06:56:12 PST
Matt, I cannot reproduce this issue with a new install. We recently fixed some bug that had to do with upper/lower case. Did you execute an upgrade? If that doesn't help: Can you please send me the result of the following two SQLs in your database:

select * from versions where product = 'roundedCorners';

select * from plugin_settings where plugin_name = 'roundedcornersplugin';

Please also note that the rounded corners plug-in will only work in journal context because it's not a sitewide plug-in. So there's no way that I know of to enable it for the home page for example.
Comment 5 Matthew Crider 2010-12-13 13:41:37 PST
Florian, The issue with the rounded corners plugin was fixed with a new install of OJS.  However, the plugin James wrote still does not load unless there is an entry for it in the versions table.  Is this by design?  I thought the system would still be able to load a plugin even if its version is not tracked.  I (or James) can send you the plugin if it helps.
Comment 6 jerico 2010-12-13 14:14:01 PST
You have to run the upgrade script to install the plug-in or install it via the web installer. In fact AFAICS many plug-in installations always required the upgrade script to be run (even in 2.x) for extra schema or data installation to work. It is true, though, that some plug-ins would work in 2.x without running the upgrade script (or pass through the web plug-in management interface). This is no longer the case since the versions table has been introduced.