Announcement

  •  » Extensions
  •  » Notice: Trying to access array offset on value of type null

#1 2021-03-08 09:52:33

diabilden
Member
2019-05-08
6

Notice: Trying to access array offset on value of type null

After update to 11.3.0 I got the following:

Notice: Trying to access array offset on value of type null in /web/se/xxx/plugins/meta/main.inc.php on line 183 and others

Meta Revision 11.0.a
Piwigo 11.3.0
Operativ system: Linux
PHP: 7.4.3

inactivate meta and no error (as expected)

Offline

 

#2 2021-03-08 13:28:25

flop25
Piwigo Team
2006-07-06
7036

Re: Notice: Trying to access array offset on value of type null

Hello

I've notified the author. While it should be fixed, that's not exactly an error : I recommand you to not display Notice messages if you are in a live production server and not debugging something.
in your piwigo local config add :
conf['show_php_errors'] = 'E_ALL & ~E_NOTICE | E_STRICT';


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#3 2021-03-08 13:46:11

diabilden
Member
2019-05-08
6

Re: Notice: Trying to access array offset on value of type null

entering
conf['show_php_errors'] = 'E_ALL & ~E_NOTICE | E_STRICT';
gives
Fatal error: Cannot use temporary expression in write context in /web/se/xxx/plugins/LocalFilesEditor/include/functions.inc.php(45) : eval()'d code on line 5

entering
$conf['show_php_errors'] = 'E_ALL & ~E_NOTICE | E_STRICT'; works but Notice still remains

Last edited by diabilden (2021-03-08 13:51:08)

Offline

 

#4 2021-03-08 13:50:13

flop25
Piwigo Team
2006-07-06
7036

Re: Notice: Trying to access array offset on value of type null

the dollar was lost during my copy/paste

$conf['show_php_errors'] = 'E_ALL & ~E_NOTICE | E_STRICT';


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#5 2021-03-08 15:23:40

erAck
Only trying to help
2015-09-06
1158

Re: Notice: Trying to access array offset on value of type null

The single quotes around the constants are wrong, they lead to assigning a string to the config value instead of a numeric value. Oring E_STRICT onto the value is unnecessary, unless one uses dead PHP versions earlier than 5.4.0, it is included in E_ALL since then. For production sites this is sufficient

Code:

$conf['show_php_errors'] = E_ALL & ~E_DEPRECATED & ~E_NOTICE;

which can also be expressed as
$conf['show_php_errors'] = E_ALL & ~(E_DEPRECATED | E_NOTICE);

See also https://www.php.net/manual/en/errorfunc.constants.php


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

Offline

 

#6 2021-03-08 15:27:30

flop25
Piwigo Team
2006-07-06
7036

Re: Notice: Trying to access array offset on value of type null

erAck wrote:

The single quotes around the constants are wrong, they lead to assigning a string to the config value instead of a numeric value.

Code:

$conf['show_php_errors'] = E_ALL & ~E_DEPRECATED & ~E_NOTICE;

+1 !


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#7 2021-03-08 15:58:31

diabilden
Member
2019-05-08
6

Re: Notice: Trying to access array offset on value of type null

Thanks all for quick reply. Now it's working

Offline

 
  •  » Extensions
  •  » Notice: Trying to access array offset on value of type null

Board footer

Powered by FluxBB

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