Error while upgrading from 7.13.0 to 7.14.0

Upgrading from 7.13.0 to 7.14.0 I get the following error:

Fatal error: Uncaught Error: Non-static method MetaParser::hasMultiplePanels() cannot be called statically in /suitecrmroot/modules/UpgradeWizard/SugarMerge/EditViewMerge.php:612 Stack trace: #0 /suitecrmroot/modules/UpgradeWizard/SugarMerge/EditViewMerge.php(576): EditViewMerge->getFields(Array) #1 /suitecrmroot/modules/UpgradeWizard/SugarMerge/EditViewMerge.php(778): EditViewMerge->mergeMetaData() #2 /suitecrmroot/modules/UpgradeWizard/SugarMerge/SugarMerge.php(204): EditViewMerge->merge(‘Meetings’, ‘modules/Meeting…’, ‘/is/htdocs/wp10…’, ‘custom/modules/…’, true) #3 /suitecrmroot/modules/UpgradeWizard/SugarMerge/SugarMerge.php(172): SugarMerge->mergeFile(‘Meetings’, ‘editviewdefs.ph…’, true, true) #4 /suitecrmroot/modules/UpgradeWizard/SugarMerge/SugarMerge.php(140): SugarMerge->mergeModule(‘Meetings’, true, true, true) #5 /suitecrmroot/modules/UpgradeWizard/commit.php(275): SugarMerge->mergeAll(true, true, true) #6 /suitecrmroot/modules/UpgradeWizard/index.php(298): require(‘/is/htdocs/wp10…’) #7 /suitecrmroot/include/MVC/View/SugarView.php(824): include_once(‘/is/htdocs/wp10…’) #8 /suitecrmroot/include/MVC/View/views/view.classic.php(72): SugarView->includeClassicFile(‘cache/smarty/te…’) #9 /suitecrmroot/include/MVC/View/SugarView.php(210): ViewClassic->display() #10 /suitecrmroot/include/MVC/Controller/SugarController.php(432): SugarView->process() #11 /suitecrmroot/include/MVC/Controller/SugarController.php(363): SugarController->processView() #12 /suitecrmroot/include/MVC/SugarApplication.php(101): SugarController->execute() #13 /suitecrmroot/index.php(52): SugarApplication->execute() #14 {main} thrown in /suitecrmroot/modules/UpgradeWizard/SugarMerge/EditViewMerge.php on line 612

Has somebody any idea? What can I do?

Looks like a PHP version issue.

Check the compatibility matrix and make sure you stay inside it

I think you might need to manually fix this file
Because the minimum version required for SuiteCRM 7.14 is php 8.1 and since php 8 this a fatal error that non static member functions cannot be called statically

Just to the definition of the function that is causing the error and add static in it’s definition

Yesterday I tried it with php 8.0 (according to suitecrm 7.13) and with php 8.1.
The error was the same.

So I think I have to edit EditViewMerge.php as proposed by abuzarfaris.
I would change from line 610:

    if ($this->scanForMultiPanel) {
        require_once('include/SugarFields/Parsers/MetaParser.php');
        if ($setDefaultPanel || !MetaParser::hasMultiplePanels($panels)) {
            $panels = array($this->defaultPanel=>$panels);
            $this->isMultiPanel = false;
        }
    }

to

    if ($this->scanForMultiPanel) {
        require_once('include/SugarFields/Parsers/MetaParser.php');
        if ($setDefaultPanel) {
            $panels = array($this->defaultPanel=>$panels);
            $this->isMultiPanel = false;
        }
		else
		$varMetaParser = new MetaParser();			
        if (!$varMetaParser->hasMultiplePanels($panels)) {
            $panels = array($this->defaultPanel=>$panels);
            $this->isMultiPanel = false;
        }				
    }

It could be correct?

Hi @heitmann,

Thanks for your feedback.

Could you provide some more info about your environment, please?

Namely what php and os version are you using? from what I’ve understood its php 8.0?

System: Linux 4.19.0-24-amd64 #1 SMP Debian 4.19.282-1 (2023-04-29) x86_64 GNU/Linux
Server API: Apache 2.0 Handler
PHP Version: 8.0.29

Thank you @heitmann.

On your php.ini what is the value that you have set for error_reporting?

Hey
This is probably a better fix

       if ($this->scanForMultiPanel) {
            require_once('include/SugarFields/Parsers/MetaParser.php');
            $hasMultiplePanels=(new MetaParser())->hasMultiplePanels($panels);
            if ($setDefaultPanel || !$hasMultiplePanels) {
                $panels = array($this->defaultPanel=>$panels);
                $this->isMultiPanel = false;
            }
        }

There’s a similar code around line 696

The value error_reporting: 277

Sadly
Even in the new release 7.14 this is still the same “a non static method is being used statically”
So this will also not work with php version greater than and equal to 8.0

Hi @heitmann @abuzarfaris

In the new release this has been changed to:

        if ($this->scanForMultiPanel) {
            require_once('include/SugarFields/Parsers/MetaParser.php');
            if ($setDefaultPanel || !$this->hasMultiplePanels($panels)) {
                $panels = array($this->defaultPanel => $panels);
                $this->isMultiPanel = false;
            }
        }

and

    public function hasMultiplePanels($panels)
    {
        if (!isset($panels) || empty($panels) || !is_array($panels)) {
            return false;
        }

        if (is_array($panels) && (count($panels) == 0 || count($panels) == 1)) {
            return false;
        }

Related with this issue and with upgrades, some of the tests we’ve done before the release were:

  • Upgrade from SuiteCRM 7.13 to SuiteCRM 7.14 using php 7.4
  • Upgrade from SuiteCRM 7.13 to SuiteCRM 7.14 using php 8.0
  • Upgrade from SuiteCRM 7.13 to SuiteCRM 7.14 using php 8.2

We’ve just re-tested the following scenario and it is working ok:

  • Upgrade from SuiteCRM 7.13 to SuiteCRM 7.14 using php 8.0

I think there must be something else. My hints at the moment are:

  • error_reporting
  • php caching

I’m having a look at our environment to see what we have

I’ll try to get feedback soon

It’s an issue occuring while merging views

Hi @abuzarfaris @heitmann,

I was looking into the suite 8 code before.

The Suite 7 still has:

        if ($this->scanForMultiPanel) {
            require_once('include/SugarFields/Parsers/MetaParser.php');
            if ($setDefaultPanel || !MetaParser::hasMultiplePanels($panels)) {
                $panels = array($this->defaultPanel=>$panels);
                $this->isMultiPanel = false;
            }
        }

That needs changed.

@abuzarfaris thank you for the clue. Got it, I think I’ve understood what we are missing

1 Like

Thanks. I will test it tomorrow.

With the changes, the upgrade worked. Thanks for the support.

1 Like

Does SuiteCRM 7.14.0 support PHP 8.0 after upgrading from SuiteCRM 7.12.5 using upgrade wizrad ?