xoops forums

stonez

Just popping in
Posted on: 11/10 4:00
stonez
stonez (Show more)
Just popping in
Posts: 14
Since: 2002/9/29
#1

Internal Error - Upgrade from 2.3.3b to 2.5.8

Hi there,
I have an old website built with Xoops 2.3.3b and customized theme and module.
Recently, I would like to upgrade Xoops 2.3.3b to 2.5.9 to be able to use with PHP 7.2.11
Environment:
OS: Linux
Apache: 2.0
PHP: 7.2.11
MySQL: 5.0.12
Xoops: 2.3.3b upgrade to 2.5.9

I was able to execute to this step:
Resized Image


When I was ready to update old modules, it showed this error message:
Resized Image


Where should I start to debug?
What settings should look into? xoops_data/data/secure.php xoops/html/mainfile.php or others?

Thank you!
Stonez

geekwright

Quite a regular
Posted on: 11/10 19:55
geekwright
geekwright (Show more)
Quite a regular
Posts: 251
Since: 2010/10/15
#2

Re: Internal Error - Upgrade from 2.3.3b to 2.5.8

The most likely cause of the error is some code in an old module which includes the phrase:
=& new

An example of this would look something similar to:
$object =& new ClassName();


That syntax was deprecated in PHP 5, but is now an error in PHP 7. The "=&' is assigning a value by reference, but the return of "new" is already a reference. Remove the "&" and that should fix it.

It would be worth checking to see if any PHP 7 ready upgrades are available for any modules you may be using.

stonez

Just popping in
Posted on: 11/10 23:01
stonez
stonez (Show more)
Just popping in
Posts: 14
Since: 2002/9/29
#3

Re: Internal Error - Upgrade from 2.3.3b to 2.5.8

Hi Geekwright ,
Thank you for the reply!
Let me try to see any of that command was used in the code first!

Will get back to you soon.

Best regards,
Stonez

stonez

Just popping in
Posted on: 11/11 7:21
stonez
stonez (Show more)
Just popping in
Posts: 14
Since: 2002/9/29
#4

Re: Internal Error - Upgrade from 2.3.3b to 2.5.8

Hi Geekwright,
I have used the Linux command grep --include=*.php -rnw './' -e "=& new" from Linux command to find all text with "=& new" and edit all "=& new" to "= new". and it worked!!

Thank you very much!!

From Xoops 2.3.3b to Xoops 2.5.9, here all the files I have updated.

./modules/dictionary/reader.php:261: $this->_ole =& new OLERead();
./modules/extcal/class/pear/Calendar/Decorator/Wrapper.php:68: $ret =& new $decorator($Calendar);
./modules/extcal/class/ExtcalPersistableObjectHandler.php:53: $obj =& new $this->className();
./modules/tad_player/class/fckeditor/editor/plugins/ImageManager/Classes/Transform.php:133: $obj =& new $classname;
./modules/thadmin/admin/help.php:25:$tpl =& new XoopsTpl();
./modules/thadmin/admin/index.php:25:$tpl =& new XoopsTpl();
./modules/thadmin/extras/cp_functions.php:57: $admTpl =& new XoopsTpl();
./modules/thadmin/extras/cp_functions.php:198: $admTpl =& new XoopsTpl();
./modules/thadmin/include/cp_functions.php:46: $adminThemeFactory =& new XoopsThAdminThemeFactory();
./modules/tinyd0/admin/mytplsform.php:98: $diff =& new Text_Diff( file( $basefilepath ) , explode("\n",$tpl['tpl_source']) ) ;
./modules/tinyd0/admin/mytplsform.php:99: $renderer =& new Text_Diff_Renderer_unified();
./modules/tinyd0/admin/mytplsform.php:116: $diff =& new Text_Diff( explode("\n",$default_source) , explode("\n",$tpl['tpl_source']) ) ;
./modules/tinyd0/admin/mytplsform.php:117: $renderer =& new Text_Diff_Renderer_unified();

stonez

Just popping in
Posted on: 11/11 7:40
stonez
stonez (Show more)
Just popping in
Posts: 14
Since: 2002/9/29
#5

Re: Internal Error - Upgrade from 2.3.3b to 2.5.8

Although I was able to update all the modules I have installed to latest version, few of them still refuse to work

1. TinyD module: HTTP ERROR 500
2. PiCal module: Error: Call to undefined function ereg()

Still looking for solutions!

Thanks,

Stonez

geekwright

Quite a regular
Posted on: 11/11 20:45
geekwright
geekwright (Show more)
Quite a regular
Posts: 251
Since: 2010/10/15
#6

Re: Internal Error - Upgrade from 2.3.3b to 2.5.8

Quote:

stonez wrote:
...
2. PiCal module: Error: Call to undefined function ereg()
...


The whole family of ereg functions were removed in PHP 7. They had been deprecated since PHP 5.3.

Here is a stackoverflow explanation and recipe for replacing ereg():
https://stackoverflow.com/questions/62 ... xpressions-to-preg-in-php