picocms / Pico

Pico is a stupidly simple, blazing fast, flat file CMS.
http://picocms.org/
MIT License
3.83k stars 614 forks source link

Trying to access array offset on value of type null #528

Closed ernibert closed 4 years ago

ernibert commented 4 years ago

Hi guys, first of: Thanks for creating and maintaining Pico. It's so great! Thanks!

Just one thing: My error.log gets filled with a good amount of following lines:

[Sun Feb 09 13:11:30.006957 2020] [php7:notice] [pid 1200] [client a.b.c.d:59702] PHP Notice: Trying to access array offset on value of type null in /path/to/pico/vendor/erusev/parsedown-extra/ParsedownExtra.php on line 338, referer: https://what.ever.tld

Is there something for me to fix (or at least as a workaround, to hide) it?

I've pico-2.1.1 installed. If you need additional info, let me know.

-- Thomas

PhrozenByte commented 4 years ago

Unfortunately we currently got some issues with Parsedown in general, not sure about a solution yet... :unamused:

In the meantime you could exclude E_NOTICE errors from being logged. Add the following to your PHP config. I highly recommend doing this for Pico only!

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE

You can either add this to your virtual-host-specific php.ini or, alternatively, if you're running Apache with mod_php, you can also use .htaccess like the following:

php_value error_reporting "E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE"

E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE reads as: report (and possibly also log) all errors except E_DEPRECATED (i.e. deprecation warnings), E_STRICT (i.e. strict coding warnings) and E_NOTICE (i.e. coding notices; this is what you're seeing). Excluding E_DEPRECATED and E_STRICT is recommended in production in general.

ernibert commented 4 years ago

Thanks for the quick reply. I used the virtual-host approach in .htaccess.

Works perfect so far :-)

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two days if no further activity occurs. Thank you for your contributions! :+1:

PhrozenByte commented 4 years ago

Labelling this as type: Bug and status: Resolved - type: Question was just wrong (my bad).

I've just created Pico v3.0.0-alpha.1 resolving this issue by upgrading (resp. "downgrading" for Parsedown, even though that's not really true either, it's a weird situation...) Pico's dependencies. See https://github.com/picocms/Pico/issues/534#issuecomment-605638655 for more info.

If you're going to try it out, please let me know about your experiences.

KoljaL commented 4 years ago

Hey PhrozenByte

I installed the 3.0.0-alpha1 on my Webspace and added the learn2 Theme, which includes the PageList-Plugin. It works fine, but after installing the PicoEditor i get this message: Notice: Trying to access array offset on value of type null in /www/htdocs/domain.de/plugins/PicoPagesList/PicoPagesList.php on line 67 But the Editor is still working.

Thanks for your great small CMS :-)

PhrozenByte commented 4 years ago

This is an issue with the plugin PicoPagesList and different from the issue mentioned above (what indeed is an issue with Pico's core resp. one of Pico's dependencies). Please let the plugin developer know about this (rather small, but nevertheless) issue. You should experience this issue no matter the Pico version (i.e. with both Pico 2.1 and Pico 3.0.0-alpha.1). Anyway, even though it's a different issue you can still follow the same instructions as above to hide it: https://github.com/picocms/Pico/issues/528#issuecomment-583852719

KoljaL commented 4 years ago

I will do so. Thanks for your quick reply.