#1 2023-12-19 15:54:45

OpenPicture
Member
2023-12-19
57

PHP 8.1 error in admin.php in Piwigo 14.0

Hello,

With Piwigo 14.0 I get the following error that I didn't have in Piwigo 13.8:

PHP Warning:  Undefined array key "SHOWMOGI" in /_data/templates_c/p6jhns^14fa551f995c229031db643b81ce50a63c8802ee_0.file.mog_adminphoto.tpl.php on line 121
PHP Warning:  Attempt to read property "value" on null in /_data/templates_c/p6jhns^14fa551f995c229031db643b81ce50a63c8802ee_0.file.mog_adminphoto.tpl.php on line 121

Here is the content of line 121 in p6jhns^14fa551f995c229031db643b81ce50a63c8802ee_0.file.mog_adminphoto.tpl.php :
<?php if (($_smarty_tpl->tpl_vars['SHOWMOGI']->value == 1)) {?>
    <span style="margin: 0 0 0 20px"><?php echo l10n('Metadata Open Graph link image');?>

Have a nice day,
OpenPicture

Environment
Piwigo 14.0.0 Check for upgrade
Installed on 26 November 2016, 7 years 3 weeks 2 days ago
Operating system: Linux
PHP: 8.1.26 (Show info) [2023-12-19 14:35:36]
MySQL: 8.0.35-cll-lve [2023-12-20 03:35:36]
Graphics Library: ImageMagick 6.9.12-93
Cache size 1733.47 Mo

Theme: Bootstrap Darkroom 2.5.18

Activated plugins (that give no PHP 8.1 errors)
Add < head > element
Additional Pages
Advanced Menu Manager
Change who added photo
Community
Crypto Captcha
Edit Filename
Embedded Videos
Extended Description
Grum Plugins Classes.3
GThumb+
Header Manager
Language Switch
LocalFiles Editor
Media Icon
Meta Open Graph
Most Commented
Permalink Generator
Perso Footer
Personal Favicon
Personal Plugin
Photo Update
Posted Date Changer
Rotate Image
RV Thumb Scroller
Smilies Support
Stop Spammers
Update Album
user delete photo

Deactivated plugins (that give PHP 8.1 errors)
Charlie's content 3.5
Check Uploads
PWG Stuffs
SmartAlbums
Thumbnail Tooltip
URL Uploader
User Tags
Whois online

Offline

 

#2 2023-12-19 21:04:23

erAck
Only trying to help
2015-09-06
2236

Re: PHP 8.1 error in admin.php in Piwigo 14.0


Running Piwigo at https://erack.net/gallery/

Offline

 

#3 2023-12-20 00:30:56

OpenPicture
Member
2023-12-19
57

Re: PHP 8.1 error in admin.php in Piwigo 14.0

Thanks erAck,

So I guess Metadata Open Graph 14.0.a also gives these errors. What's a bit curious is that I get the error even when all plugins are disabled.

Offline

 

#4 2023-12-20 07:04:04

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7340

Re: PHP 8.1 error in admin.php in Piwigo 14.0

Hi :-)

afer update with new plugin release ?


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#5 2023-12-20 14:16:24

OpenPicture
Member
2023-12-19
57

Re: PHP 8.1 error in admin.php in Piwigo 14.0

Hello ddtddt,

Yes, I have updated to Metadata Open Graph 14.0.a, but errors keep appearing with PHP 8.1 in my PHP error log file. I have already emptied the cache, purged compiled templates and trashed all files in templates_c folder.

The errors only stop when I go back to PHP 7.4 with Piwigo 14.0.

Offline

 

#6 2023-12-21 07:10:11

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7340

Re: PHP 8.1 error in admin.php in Piwigo 14.0

Hi :-)

in file initadmin.php line 92 have you

   $template->assign('SHOWMOGI', "1");
  }else{
   $template->assign('SHOWMOGI', "0");
  }


if no download file and replace

if yas can you replace 0 by a ?


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#7 2023-12-21 15:50:13

OpenPicture
Member
2023-12-19
57

Re: PHP 8.1 error in admin.php in Piwigo 14.0

Hi ddtddt,

Yes, in file initadmin.php line 92 I have :

$template->assign('SHOWMOGI', "1");
  }else{
   $template->assign('SHOWMOGI', "0");
  }

and I changed it to :

$template->assign('SHOWMOGI', "1");
  }else{
   $template->assign('SHOWMOGI', "?");
  }

But I still get the following error:

Undefined array key "SHOWMOGI" in /_data/templates_c/p6jhns^14fa551f995c229031db643b81ce50a63c8802ee_0.file.mog_adminphoto.tpl.php on line 121
[21-Dec-2023 14:38:46 UTC] PHP Warning:  Attempt to read property "value" on null in /_data/templates_c/p6jhns^14fa551f995c229031db643b81ce50a63c8802ee_0.file.mog_adminphoto.tpl.php on line 121
[21-Dec-2023 14:38:47 UTC] PHP Warning:  Undefined array key "SHOWMOGI" in /_data/templates_c/p6jhns^14fa551f995c229031db643b81ce50a63c8802ee_0.file.mog_adminphoto.tpl.php on line 121
[21-Dec-2023 14:38:47 UTC] PHP Warning:  Attempt to read property "value" on null in /_data/templates_c/p6jhns^14fa551f995c229031db643b81ce50a63c8802ee_0.file.mog_adminphoto.tpl.php on line 121

Here is line 121:

<?php if (($_smarty_tpl->tpl_vars['SHOWMOGI']->value == 1)) {?>
    <span style="margin: 0 0 0 20px"><?php echo l10n('Metadata Open Graph link image');?>
</span>

Offline

 

#8 2023-12-27 15:11:32

OpenPicture
Member
2023-12-19
57

Re: PHP 8.1 error in admin.php in Piwigo 14.0

Could it be that the problem is not related to the Metadata Open Graph plugin?

Offline

 

#9 2023-12-27 17:03:42

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7340

Re: PHP 8.1 error in admin.php in Piwigo 14.0

Hi :-)

in file mog_adminphoto.tpl can you replace line 76

  {if ($SHOWMOGI==1)}

by

  {if isset($metagestion) and ($SHOWMOGI==1)}


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#10 2023-12-27 20:11:57

OpenPicture
Member
2023-12-19
57

Re: PHP 8.1 error in admin.php in Piwigo 14.0

Hi ddtddt,

With {if isset($metagestion) and ($SHOWMOGI==1)}, the error is gone in my log file.

Offline

 

Board footer

Powered by FluxBB