PKP Bugzilla – Bug 6282
Lazy loaded plugins are not adding their required data to the header
Last modified: 2010-12-13 14:14:01 PST
We are moving to Git Issues for bug tracking in future releases. During transition, content will be in both tools. If you'd like to file a new bug, please create an issue.
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.
Matt, can you please check if the fix for Bug 6279 resolves this?
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).
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.
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.
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.
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.