Announcement

  •  » Beta testing
  •  » 12.0.0RC2: Undefined array key messages (PHP 8)

#1 2021-10-15 03:15:34

windracer
Member
St. Pete, FL
2014-12-28
445

12.0.0RC2: Undefined array key messages (PHP 8)

I just upgraded my server to Ubuntu 21.10, which came with PHP 8. This broke my primary Piwigo site since it was still running 11.5 so I went ahead and upgraded to 12.0.0RC2 (my beta/testing site was already on 12.0.0RC2).

That got the site working, but I'm seeing a LOT of PHP warnings on pages, which prevents some pages from loading properly (no image thumbnails, broken pages in the admin section, etc.). They're mostly "undefined array key" messages, like this:

Code:

<b>Warning</b>:  Undefined array key "view" in <b>/mnt/media/Pictures/piwigo/wr_data/templates_c/lls45p^c9310276890b3017bb99a16408d5f7d91d83e11f_0.file.thumbnails.tpl.php</b> on line <b>78</b><br />
 d-block">

Another example, from the main page:

Code:

<b>Warning</b>:  Undefined array key "level" in <b>/mnt/media/Pictures/piwigo/wr_data/templates_c/lls45p^bb98cfaf8e797b60cbed66e1b7209fcaf7566f4f_0.file.menubar_tags.tpl.php</b> on line <b>34</b><br />
" href="index.php?/tags/3669-amy" title="display photos linked to this tag">amy</a>
        <a class="dropdown-item tagLevel<br />

And user manager:

Code:

<b>Warning</b>:  Undefined array key "associate_selected" in <b>/mnt/media/Pictures/piwigo/wr_data/templates_c/p6jhns^c90e21c90b49112533d030a4da07114d285b1852_0.file.user_list.tpl.php</b> on line <b>438</b><br />

I've tried purging the cache and compiled templates, but can't seem to get rid of these. Any suggestions on where to look?

Piwigo 12.0.0RC2
Operating system: Linux
PHP: 8.0.8 (Show info) [2021-10-14 21:12:14]
MySQL: 8.0.26-0ubuntu1 [2021-10-14 21:12:14]
Graphics Library: ImageMagick 6.9.11-60

Last edited by windracer (2021-10-15 03:18:57)

Offline

 

#2 2021-10-15 16:32:17

windracer
Member
St. Pete, FL
2014-12-28
445

Re: 12.0.0RC2: Undefined array key messages (PHP 8)

I've really broken something ... thumbnails in albums aren't loading either:

https://www.windracer.net/outgoing/piwigo/broken-thumbnails.jpg

Offline

 

#3 2021-10-15 16:53:54

windracer
Member
St. Pete, FL
2014-12-28
445

Re: 12.0.0RC2: Undefined array key messages (PHP 8)

I think I may try going back to PHP 7.4 ...

Offline

 

#4 2021-10-15 23:35:36

windracer
Member
St. Pete, FL
2014-12-28
445

Re: 12.0.0RC2: Undefined array key messages (PHP 8)

Rolling back to 7.4 wasn't a readily available option, but I was able to fix all of my issues by adding E_WARNING to show_php_errors in my local config:

Code:

$conf['show_php_errors'] = E_ALL ^ E_DEPRECATED ^ E_WARNING;

All of the warnings were breaking the HTML which was causing the problems like the images not loading. This fix seems a little heavy-handed, but at least my sites are functional again.

Offline

 

#5 2021-10-15 23:53:35

erAck
Only trying to help
2015-09-06
2019

Re: 12.0.0RC2: Undefined array key messages (PHP 8)

See also [Forum, post 180778 by erAck in topic 31258] Error Message for a generally better approach to log error messages instead of displaying them.


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

Offline

 
  •  » Beta testing
  •  » 12.0.0RC2: Undefined array key messages (PHP 8)

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact