ulsdevteam / pkp-clamav

Clam AV plugin for PKP OJS / OMP
GNU General Public License v2.0
5 stars 5 forks source link

Plugin causes hard failure if present at install time #4

Closed ctgraham closed 4 years ago

ctgraham commented 4 years ago

Call to the DAO factory should not occur before installation. https://github.com/ulsdevteam/pkp-clamav/blob/6ddb95bfe6e9ed64384f1b2824f85fe3e77e3ae4/ClamavPlugin.inc.php#L37-L38 This check needs to pre-empt that: https://github.com/ulsdevteam/pkp-clamav/blob/6ddb95bfe6e9ed64384f1b2824f85fe3e77e3ae4/ClamavPlugin.inc.php#L41-L42

ctgraham commented 4 years ago

Also, getTemplatePath() will be called at install time, so this can't be used: https://github.com/ulsdevteam/pkp-clamav/blob/6ddb95bfe6e9ed64384f1b2824f85fe3e77e3ae4/ClamavPlugin.inc.php#L150

ctgraham commented 4 years ago

C.f. https://github.com/ulsdevteam/pkp-formHoneypot/issues/9

ctgraham commented 4 years ago

We need to re-write the getTemplatePath() method to not depend on the DAOs.

If register() calls parent::register() before setting the currentAppVersion the template path may be wrong. If register() defers parent::register() to avoid calling it during installation, we get an empty product name in the versions table.

The solution may be just to drop backwards compatibility support in master.

ctgraham commented 4 years ago

Resolved 1653242