Issue upgrading with admin/cfg_modules

Ask the community for help and support.
Post Reply
Greasemonkey
VIP Member
VIP Member
Posts: 13
Joined: Thu Apr 01, 2021 2:07 am
Has thanked: 4 times

Issue upgrading with admin/cfg_modules

Post by Greasemonkey »

Hey all, I'm working on upgrading an installation I've been testing using @zipurman fantastic upgrading tool.

Everything has been going smoothly - however have run into an issue with admin/cfg_modules at v 1.0.7.7 with

Code: Select all

            $this->_modules[] = [
              'code' => $class::CODE,
              'directory' => $class::DIRECTORY,
              'language_directory' => $class::LANGUAGE_DIRECTORY,
              'key' => $class::KEY,
              'title' => $class::TITLE,
              'template_integration' => $class::TEMPLATE_INTEGRATION,
Complaining like this
[22-Jul-2021 12:32:16 America/Toronto] PHP Fatal error: Uncaught Error: Undefined class constant 'CODE' in /home/xxxxx/public_html/*****/admin/includes/classes/cfg_modules.php:26
Stack trace:
#0 /home/xxxxx/public_html/*****/admin/includes/application_top.php(150): cfg_modules->__construct()
#1 /home/xxxxx/public_html/*****/admin/index.php(13): require('/home/flournet/...')
#2 {main}
thrown in /home/xxxxx/public_html/*****/admin/includes/classes/cfg_modules.php on line 26
The old code works perfect.... I see no reason, other than some sort of php configuration why the new code won't work - ideas?
ecartz
Lead Developer
Lead Developer
Posts: 1148
Joined: Tue Nov 05, 2019 6:02 pm
Has thanked: 4 times
Been thanked: 119 times

Re: Issue upgrading with admin/cfg_modules

Post by ecartz »

Have you updated any cfg_modules provided by add-ons as posted at https://github.com/CE-PhoenixCart/Phoen ... 5615b8d352
Greasemonkey
VIP Member
VIP Member
Posts: 13
Joined: Thu Apr 01, 2021 2:07 am
Has thanked: 4 times

Re: Issue upgrading with admin/cfg_modules

Post by Greasemonkey »

@ecartz ahhhh.... perfect yes. Working on this now.
Greasemonkey
VIP Member
VIP Member
Posts: 13
Joined: Thu Apr 01, 2021 2:07 am
Has thanked: 4 times

Re: Issue upgrading with admin/cfg_modules

Post by Greasemonkey »

@ecartz maybe you can help track down another one - now with a content module?

I have
[23-Jul-2021 10:09:33 America/Toronto] PHP Fatal error: Uncaught Error: Cannot declare self-referencing constant 'self::CONFIG_KEY_BASE' in /home/xxxx/public_html/*****/admin/modules_content.php:38
Stack trace:
#0 {main}
thrown in /home/xxxx/public_html/*****/admin/modules_content.php on line 38
However can't find any content module using: self::CONFIG_KEY_BASE.

I was going to just shut off each module one by one till I found it.... but the content module admin page is what get the fatal error.

Maybe just renaming them to .old one by one?
ecartz
Lead Developer
Lead Developer
Posts: 1148
Joined: Tue Nov 05, 2019 6:02 pm
Has thanked: 4 times
Been thanked: 119 times

Re: Issue upgrading with admin/cfg_modules

Post by ecartz »

Greasemonkey wrote: Fri Jul 23, 2021 2:55 pm Maybe just renaming them to .old one by one?
Or just move them into a temporary directory (e.g. contents_temp) and move them back until you find the one that's not working. That might be easier than renaming, which would also work. Just rename the directory, create a new contents directory and copy the folders back in one-by-one.

In 1.0.8.4, you would still have https://github.com/CE-PhoenixCart/Phoen ... 488f9dac4f unless you fixed it manually.
User avatar
zipurman
PhoenixCart Developer
PhoenixCart Developer
Posts: 215
Joined: Tue Oct 13, 2020 5:20 pm
Location: Canada (CST)
Has thanked: 44 times
Been thanked: 83 times

Re: Issue upgrading with admin/cfg_modules

Post by zipurman »

Greasemonkey wrote: Fri Jul 23, 2021 2:55 pm Maybe just renaming them to .old one by one?
Another debug option is to edit admin/modules_content.php and add:

echo $class;

Above the "if (class_exists($class)) {"

which will show you the classes being loaded. If the error is visible on the screen, this should help. If it's in the logs only, you could:

error_log('my debug: ' . $class);

This method also helps you get a better understanding of how Phoenix loads modules.

Obviously, after you fix the issue, remove any changes you made to modules_content.php
zipurman
aka Preston Lord
-----------
Happy to help where I can ;)

https://phoenixaddons.com
https://www.youtube.com/zipurman/ ** PHOENIX HOW-TO VIDEOS **
Image
Post Reply