PHP Fatal error: Call to a member function compare() on null in .../classes/plugins/Plugin.inc.php on line 43

Please help to correct the error. Cannot upgrade version 2.3.6.0 to any version 2 * .* . *
I get an error after sudo php5.6 tools/upgrade.php check

PHP Fatal error: Call to a member function compare() on null in /var/www/html/conferences/classes/plugins/Plugin.inc.php on line 43

File Plugin.inc.php on line 43:

/**

  • Backwards compatible convenience version of
  • the generic getContextSpecificSetting() method.
  • @see PKPPlugin::getContextSpecificSetting()
  • @param $journalId
  • @param $name
    */
    function getSetting($journalId, $name) {
    if (defined(‘RUNNING_UPGRADE’)) {
    // Bug #2504: Make sure plugin_settings table is not
    // used if it’s not available.
    $versionDao =& DAORegistry::getDAO(‘VersionDAO’);
    $version =& $versionDao->getCurrentVersion();
    line 43 → If ($version->compare(‘2.1.0’) < 0) return null;
    }
    return $this->getContextSpecificSetting(array($journalId), $name);
    }

I commented on line 43. Got the following error. It is known that the system cannot find the current version
PHP Fatal error: Call to a member function getVersionString() on null in /var/www/html/conferences/lib/pkp/classes/cliTool/UpgradeTool.inc.php on line 241

Does anyone know what it could be?

It seems that the problem is that I have a very outdated version of OJS. During the tools/upgrade.php check, the system cannot determine the Database version ($dbVersion = VersionCheck::getCurrentDBVersion(); )
How do I upgrade if I can’t pass this stage

Hi @sdn.cibs,

Can you provide some detail about what you’re trying to accomplish? It sounds like you’re trying to upgrade OJS, but please specify your current version, and the version you’re trying to upgrade to. Also I’m not 100% clear whether you’re working with OJS or OCS.

Thanks,
Alec Smecher
Public Knowledge Project Team

I am trying to update OJS 2.3.6.0 to OJS 2.3.7.0 or later, no difference. Because the process stops at the detected current version of the base.

where in the database is this information stored and can I add or correct it myself. The system was installed in 2016, it seems that at that time there were other requests to the database regarding the version

Hi @sdn.cibs,

What does OJS self-report for its version?

Try:

php tools/upgrade.php check

Regards,
Alec Smecher
Public Knowledge Project Team

PHP Fatal error: Call to a member function compare() on null in /var/www/html/conferences/classes/plugins/Plugin.inc.php on line 43

When you try to update through the web interface, the error is as follows:
In Apache Log: AH01071: Got error ‘PHP message: PHP Fatal error: Call to a member function compare() on null in /var/www/html/conferences/lib/pkp/classes/install/Installer.inc.php on line 318\n’,

Hi @sdn.cibs,

Another way to get the same information is by running the following database query:

SELECT * FROM versions WHERE product='ojs2' AND current=1;

Regards,
Alec Smecher
Public Knowledge Project Team

I am very sorry. But it seems I misled you. When I got to the base, I saw that it was really OCS
The topic should be closed. Sorry

Thank you for responding!

1 Like