[14.0.0.beta3] Many undefined keys and other messages #1737

Closed
opened 2026-10-05 00:54:49 +02:00 by adam · 7 comments
Owner

Using the latest 14.0.3beta and php 8.2.x results in numerous undefined keys and messages.
Made for such a few PRs , but at least you should test it with php 8.2. by yourself.

E.g. in photos_add_direct.tpl
Undefined array kay "ADD_TO_ALBUM"
Attempt to read property "value" on null

header.tpl
Undefined array key "U_RETURN"
Undefined array key "USERNAME"
Undefined array key "U_CHANGE_THEME"
Undefined array key "U_FAQ"

and so on ..

Happens after a fresh installation and calling the pages for the first time!

Using the latest 14.0.3beta and php 8.2.x results in numerous undefined keys and messages. Made for such a few PRs , but at least you should test it with php 8.2. by yourself. E.g. in **photos_add_direct.tpl** Undefined array kay "ADD_TO_ALBUM" Attempt to read property "value" on null **header.tpl** Undefined array key "U_RETURN" Undefined array key "USERNAME" Undefined array key "U_CHANGE_THEME" Undefined array key "U_FAQ" and so on .. Happens after a fresh installation and calling the pages for the first time! <!-- github-sync-id:1910265714 -->
adam closed this issue 2026-10-05 00:54:49 +02:00
Author
Owner

I don't see any error on my PHP 8.2.7. Which version of PHP 8.2.x are you using?

I don't see any error on my PHP 8.2.7. Which version of PHP 8.2.x are you using? <!-- github-comment-id:1733480956 -->
Author
Owner

PHP 8.2.0
Will update that to 8.2.4 and report here again ..

PHP 8.2.0 Will update that to 8.2.4 and report here again .. <!-- github-comment-id:1733598653 -->
Author
Owner

Nevertheless, those messages arrise after a new and fresh installation!
Those variables are simply never initialized (as so many others in several plugins) - see also several PRs here from me for such!
You should be able to see them when you make a complete new installation of the latest beta version.

Nevertheless, those messages arrise after a new and fresh installation! Those variables are simply never initialized (as so many others in several plugins) - see also several PRs here from me for such! You should be able to see them when you make a complete new installation of the latest beta version. <!-- github-comment-id:1735428670 -->
Author
Owner

Okay, here we go ... boring!

A. latest Piwigo 14.0.0.beta3 (downloaded from the piwigo.org website)
B. local environement (XAMPP, php 8.2.4 - no newer available at the moment, but not so important), WIN64

  1. Installation went quite smoothy - no errors, 2 warnings:
    PHP Warning: Trying to access array offset on value of type null in piwigo_1400beta3/admin/include/plugins.class.php on line 383

The mentioned line is: if ('webmaster' == $user['status'])
Seems that this value is not defined ..

Second warning is:
Mailer Error: Could not instantiate mail function. in piwigo_1400beta3/include/functions_mail.inc.php on line 923

Before the piwigo config values are fetched, but they are not set at this point!
if (!isset($conf_mail)) { $conf_mail = get_mail_configuration(); }

While XAMPP is set to send mails (and that works), Piwigo not.

  1. Installation final page > click on "Add Fotos":
    grafik

Clicking on that button opens the admin page, the next 2 errors are up:
PHP Warning: Undefined array key "ADD_TO_ALBUM" in _data/templates_c/....file.photos_add_direct.tpl.php on line 584 PHP Warning: Attempt to read property "value" on null in _data/templates_c/.file.photos_add_direct.tpl.php on line 584

  1. Added 2 photos, clicking on one of them .. next warnings:
    PHP Warning: Undefined array key "show_root_btn" in _data/templates_c/file.album_selector.inc.tpl.php on line 72 PHP Warning: Attempt to read property "value" on null in _data/templates_c/.file.album_selector.inc.tpl.php on line 72

  2. Enough of warnings in the backend, testing the gallery .. now other bugs!
    downloadable font: kern: Too large subtable (font-family: "Open Sans" style:normal weight:700 stretch:100 src index:0) source: https://localhost/gallery/piwigo_1400beta3/themes/modus/css/open-sans/fonts/Bold/OpenSans-Bold.woff2?v=1.101

Beside this, wrong icon is defined in the template!
grafik

As can be seen, after the x is some space - there should be an icon .. defined, but the wrong one!
Because fontawesome is not embedded nor defined within the template modus.
The wrong and missing icon:
<i class="fas fa-plus" aria-hidden="true"></i>

All of them are really stupid bugs, avoidable if enough tested.

Stopping here the test, because these warnings and wrong defined icons can be eliminated when installing Piwigo completely new with full error reporting (or checking the apache error.log).

Beside this, I have made several PRs here .. other bugs and language translations.
But no one ever replied or did anything with them.
Also because of that I am stopping now further testing, have to earn money for daily living ..

Okay, here we go ... boring! A. latest Piwigo 14.0.0.beta3 (downloaded from the piwigo.org website) B. local environement (XAMPP, php 8.2.4 - no newer available at the moment, but not so important), WIN64 1. Installation went quite smoothy - no errors, 2 warnings: `PHP Warning: Trying to access array offset on value of type null in piwigo_1400beta3/admin/include/plugins.class.php on line 383` The mentioned line is: `if ('webmaster' == $user['status'])` Seems that this value is not defined .. Second warning is: `Mailer Error: Could not instantiate mail function. in piwigo_1400beta3/include/functions_mail.inc.php on line 923` Before the piwigo config values are fetched, but they are not set at this point! `if (!isset($conf_mail)) { $conf_mail = get_mail_configuration(); }` While XAMPP is set to send mails (and that works), Piwigo not. 2. Installation final page > click on "Add Fotos": ![grafik](https://github.com/Piwigo/Piwigo/assets/1905204/804a3be0-67c9-438a-a88d-866aa9b331c0) Clicking on that button opens the admin page, the next 2 errors are up: `PHP Warning: Undefined array key "ADD_TO_ALBUM" in _data/templates_c/....file.photos_add_direct.tpl.php on line 584 PHP Warning: Attempt to read property "value" on null in _data/templates_c/.file.photos_add_direct.tpl.php on line 584` 3. Added 2 photos, clicking on one of them .. next warnings: `PHP Warning: Undefined array key "show_root_btn" in _data/templates_c/file.album_selector.inc.tpl.php on line 72 PHP Warning: Attempt to read property "value" on null in _data/templates_c/.file.album_selector.inc.tpl.php on line 72` 4. Enough of warnings in the backend, testing the gallery .. now other bugs! `downloadable font: kern: Too large subtable (font-family: "Open Sans" style:normal weight:700 stretch:100 src index:0) source: https://localhost/gallery/piwigo_1400beta3/themes/modus/css/open-sans/fonts/Bold/OpenSans-Bold.woff2?v=1.101` Beside this, wrong icon is defined in the template! ![grafik](https://github.com/Piwigo/Piwigo/assets/1905204/c957256c-8e35-4dc1-bf6f-3b4f56cd5732) As can be seen, after the x is some space - there should be an icon .. defined, but the wrong one! Because **fontawesome** is not embedded nor defined within the template modus. The wrong and missing icon: `<i class="fas fa-plus" aria-hidden="true"></i>` All of them are really stupid bugs, avoidable if enough tested. Stopping here the test, because these warnings and wrong defined icons can be eliminated when installing Piwigo completely new with full error reporting (or checking the apache error.log). Beside this, I have made several PRs here .. other bugs and language translations. But no one ever replied or did anything with them. Also because of that I am stopping now further testing, have to earn money for daily living .. <!-- github-comment-id:1737243832 -->
Author
Owner

I've been wondering for days why you see so many errors and I don't. So I made a test. In themes/default/template/tags.tpl, if I remove the and isset($tags):

-{if $display_mode == 'cloud' and isset($tags)}
+{if $display_mode == 'cloud'}

I immediately get:

Warning: Undefined array key "tags" in _data/templates_c/blablabla.file.tags.tpl.php on line 63
Warning: Attempt to read property "value" on null in _data/templates_c/blablabla.file.tags.tpl.php on line 63

So I understand my environment reacts to unset variables used by templates.

OK, after deeper investigation, I see the bug on ADD_TO_ALBUM. It was in a display:none HTML block so I couldn't see it in the page.

Screenshot 2023-09-28 at 10 44 30

these warnings and wrong defined icons can be eliminated when installing
Piwigo completely new with full error reporting

A standard installation of Piwigo on git master has error_reporting=E_ALL so don't have any doubt: if we see such a bug, we fix it before releasing, even a beta-version.

I still don't understand why those errors are showing so obviously for you and not for me but we appreciate your reports and it really helps to fix what we couldn't see 👍

Beside this, I have made several PRs here .. other bugs and language translations.

I've planned to work on them during the next hours. I also have to check this fontawesome thing.

But no one ever replied or did anything with them.

That's not true. I accept that you don't find the reaction "fast enough", but please don't say there is no reply at all :-)

I've been wondering for days why you see so many errors and I don't. So I made a test. In `themes/default/template/tags.tpl`, if I remove the ` and isset($tags)`: ``` -{if $display_mode == 'cloud' and isset($tags)} +{if $display_mode == 'cloud'} ``` I immediately get: > Warning: Undefined array key "tags" in _data/templates_c/blablabla.file.tags.tpl.php on line 63 > Warning: Attempt to read property "value" on null in _data/templates_c/blablabla.file.tags.tpl.php on line 63 So I understand my environment reacts to unset variables used by templates. OK, after deeper investigation, I see the bug on `ADD_TO_ALBUM`. It was in a `display:none` HTML block so I couldn't see it in the page. <img width="679" alt="Screenshot 2023-09-28 at 10 44 30" src="https://github.com/Piwigo/Piwigo/assets/9326959/1922253f-fce0-41b6-8f03-00a5de30a663"> > these warnings and wrong defined icons can be eliminated when installing > Piwigo completely new with full error reporting A standard installation of Piwigo on git `master` has `error_reporting=E_ALL` so don't have any doubt: if we see such a bug, we fix it before releasing, even a beta-version. I still don't understand why those errors are showing so obviously for you and not for me but we appreciate your reports and it really helps to fix what we couldn't see 👍 > Beside this, I have made several PRs here .. other bugs and language translations. I've planned to work on them during the next hours. I also have to check this fontawesome thing. > But no one ever replied or did anything with them. That's not true. I accept that you don't find the reaction "fast enough", but please don't say there is no reply at all :-) <!-- github-comment-id:1738746285 -->
Author
Owner

@plegall Okay, to be fair - "not fast enough" is also good ..

Reg. the error/message output: because I am developing normally other things, the system is configured (local and live) to display/highlight any message!
And I am confident that you (and/or many others) testing each version before going live.
That's why I am wondering why so many messages are poping up - not only for me, also at others.
So, your testsystem should be configured to display each and every message output.
And even there is no error display defined, in the apache logfile can be all found ;)

@plegall Okay, to be fair - "not fast enough" is also good .. Reg. the error/message output: because I am developing normally other things, the system is configured (local and live) to display/highlight any message! And I am confident that you (and/or many others) testing each version before going live. That's why I am wondering why so many messages are poping up - not only for me, also at others. So, your testsystem should be configured to display each and every message output. And even there is no error display defined, in the apache logfile can be all found ;) <!-- github-comment-id:1739068982 -->
Author
Owner

I keep this issue opened, in case I see other undefined key message before 14.0.0beta4

I keep this issue opened, in case I see other `undefined key` message before 14.0.0beta4 <!-- github-comment-id:1742640055 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1737