ltb-project / self-service-password

Web interface to change and reset password in an LDAP directory
https://self-service-password.readthedocs.io/en/latest/
GNU General Public License v3.0
1.18k stars 327 forks source link

PHP Warning: Undefined array keys at 1.6.0 #909

Closed 3kami3 closed 5 months ago

3kami3 commented 6 months ago

I upgraded to 1.6.0 and a PHP Warning was logged. Do I need to configure anything additional in config.inc.local.php?

[Thu May 23 21:07:31.042136 2024] [php:warn] [pid 22] [client 172.18.0.2:56836] PHP Warning:  Undefined array key "extended_error_msg" in /var/www/templates_c/286e41dd2c3e04c2d0efd05cb44c5af70eb8f2aa_2.file.index.tpl.php on line 67, referer: https://my.domain.com/index.php
[Thu May 23 21:07:31.042168 2024] [php:warn] [pid 22] [client 172.18.0.2:56836] PHP Warning:  Attempt to read property "value" on null in /var/www/templates_c/286e41dd2c3e04c2d0efd05cb44c5af70eb8f2aa_2.file.index.tpl.php on line 67, referer: https://my.domain.com/index.php
[Thu May 23 21:07:31.046295 2024] [php:warn] [pid 22] [client 172.18.0.2:56836] PHP Warning:  Undefined array key "attribute_mail_update" in /var/www/templates_c/181bd598c64907a17489511d59d14633c2561c5b_2.file.sendtoken.tpl.php on line 35, referer: https://my.domain.com/index.php
[Thu May 23 21:07:31.046313 2024] [php:warn] [pid 22] [client 172.18.0.2:56836] PHP Warning:  Attempt to read property "value" on null in /var/www/templates_c/181bd598c64907a17489511d59d14633c2561c5b_2.file.sendtoken.tpl.php on line 35, referer: https://my.domain.com/index.php
[Thu May 23 21:07:42.092700 2024] [php:warn] [pid 21] [client 172.18.0.2:51112] PHP Warning:  Undefined array key "msg_changehelpextramessage" in /var/www/templates_c/3ba7131c51edfe0cef48341f1409d3c1a60d3c16_2.file.change.tpl.php on line 43, referer: https://my.domain.com/index.php?action=sendtoken
[Thu May 23 21:07:42.092724 2024] [php:warn] [pid 21] [client 172.18.0.2:51112] PHP Warning:  Attempt to read property "value" on null in /var/www/templates_c/3ba7131c51edfe0cef48341f1409d3c1a60d3c16_2.file.change.tpl.php on line 43, referer: https://my.domain.com/index.php?action=sendtoken
davidcoutadeur commented 6 months ago

Hello @3kami3

You can:

  1. verify that the config.inc.php has been updated with the last version of self-service-password
  2. empty your cache /var/www/templates_c/
radokristof commented 6 months ago

I observe the same error on version 1.6 Downgrading to v1.5 solves the issue.

coudot commented 5 months ago

See #912, same issue?

radokristof commented 5 months ago

I don't think it is the same issue. In my case errors are not visible on UI and not related to password changing.

davidcoutadeur commented 5 months ago

I reproduce the warnings, at least for the last two messages:

[Wed Jun 19 08:13:00.291547 2024] [php:warn] [pid 19] [client 172.17.0.1:58980] PHP Warning:  Undefined array key "msg_changehelpextramessage" in /var/www/templates_c/3ba7131c51edfe0cef48341f1409d3c1a60d3c16_2.file.change.tpl.php on line 43
[Wed Jun 19 08:13:00.291562 2024] [php:warn] [pid 19] [client 172.17.0.1:58980] PHP Warning:  Attempt to read property "value" on null in /var/www/templates_c/3ba7131c51edfe0cef48341f1409d3c1a60d3c16_2.file.change.tpl.php on line 43

These messages are visible:

I'll search for a solution for not displaying these messages, but it does not seem very important.

davidcoutadeur commented 5 months ago

Fix introduced in f240685 has also produced many more messages in smarty (including useless notice)

I have made a pull request to remove smarty messages (except errors) unless $smarty_debug == true. See 3d09783

This should also remove all your warnings here.