Bug #13462

Fix PHP Warnings and Notices

Added by Dan Gillean 11 months ago. Updated 9 months ago.

Status:In progressStart date:06/09/2020
Priority:MediumDue date:
Assignee:David Juhasz% Done:

0%

Category:Internals
Target version:-
Google Code Legacy ID: Tested version:2.6
Sponsored:No Requires documentation:

Description

Note: this ticket is copied from issue #13348. Several PRs from that ticket will be added to release 2.6.2, but further work remains to be done in improving PHP warnings and notices in AtoM. This has become a general purpose ticket for future fixes on this topic, while #13348 will be closed once it is included in the 2.6.2 release

Problem

The qa/2.x AtoM code emits quite a few minor Warnings and Notices, which can make it harder to diagnose bugs, and can fill up the nginx error log with noise (depending on PHP error reporting settings).

An example:

2020/06/09 11:46:02 [error] 607#607: *31 FastCGI sent in stderr: "PHP message: PHP
Notice:  Undefined index: session_cookie_path in
/usr/share/nginx/atom/vendor/symfony/lib/storage/sfSessionStorage.class.php on line 79
PHP message: PHP Warning:  session_start(): The session id is too long or contains
illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in
/usr/share/nginx/atom/vendor/symfony/lib/storage/sfSessionStorage.class.php on line 92
PHP message: PHP Warning:  session_start(): Failed to read session data: files (path:
/var/lib/php/sessions) in
/usr/share/nginx/atom/vendor/symfony/lib/storage/sfSessionStorage.class.php on line 92
PHP message: PHP Notice:  Undefined variable: show in
/usr/share/nginx/atom/apps/qubit/modules/actor/templates/_advancedSearch.php on line 3
PHP message: PHP Notice:  Undefined variable: show in
/usr/share/nginx/atom/apps/qubit/modules/actor/templates/_advancedSearch.php on line 3
PHP message: PHP Notice:  Undefined variable: show in
/usr/share/nginx/atom/apps/qubit/modules/actor/templates/_advancedSearch.php on line 5
PHP message: PHP Warning:  count(): Parameter must be an array or an object that
implements Countable in /usr/share/nginx/atom/lib/helper/QubitHelper.php on line 355
PHP message: PHP Warning:  count(): Parameter must be an array or an object that
implements Countable in /usr/share/nginx/atom/lib/helper/QubitHelper.php on line 355
PHP message: PHP Warning:  count(): Parameter must be an array or an object that
implements Countable in /usr/share/nginx/atom/lib/helper/QubitHelper.php on line 355
PHP message: PHP Warning:  count(): Parameter must be an array or an object that
implements Countable in /usr/share/nginx/atom/lib/helper/QubitHelper.php on line 355
PHP message: PHP Warning:  count(): Parameter must be an array or an object that
implements Countable in /usr/share/nginx/atom/lib/helper/QubitHelper.php on line 355

Desired behaviour

No Warnings or Notices should be emitted in standard operation.


Related issues

Copied from Access to Memory (AtoM) - Bug #13348: Fix PHP Warnings and Notices Verified 06/09/2020

History

#1 Updated by Dan Gillean 11 months ago

  • Copied from Bug #13348: Fix PHP Warnings and Notices added

#2 Updated by José Raddaoui Marín 9 months ago

Community report about warnings from the PHP-FPM pool configuration, related to opcache and apcu:

https://github.com/artefactual/atom-docs/issues/176

#3 Updated by José Raddaoui Marín 9 months ago

Deprecation warning in the Propel tasks (from https://projects.artefactual.com/issues/13487#note-4):

djuhasz@Desktop-David:~/atomqa$ symfony propel:build-model
>> schema    converting "/atom/src/config/schema.yml" to XML
>> schema    putting /atom/src/config/generated-schema.xml
>> schema    converting "/atom/src/plugins/qbAclPlugin/config/schema.yml" to XML
>> schema    putting /atom/src/plugins/qbAclPlugin/config/generated-qbAclPlugin-schema.xml
>> schema    converting "/atom/src/plugins/qtAccessionPlugin/config/schema.yml" to XML
>> schema    putting /atom/src/plugins/qtAccessionPlugin/config/generated-qtAccessionPlugin-schema.xml
>> file+     config/generated-qbAclPlugin-schema.xml
>> file-     /atom/src/plugins/qbAclPlugin/config/generated-qbAclPlugin-schema.xml
>> file+     config/generated-qtAccessionPlugin-schema.xml
>> file-     /atom/src/plugins/qtAccessionPlugin/config/generated-qtAccessionPlugin-schema.xml
PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; Location has a deprecated constructor in /atom/src/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/phing/parser/Location.php on line 32
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Location has a deprecated constructor in /atom/src/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/phing/parser/Location.php on line 32
>> propel    Running "om" phing task
>> file-     /atom/src/config/generated-schema.xml
>> file-     /atom/src/config/generated-schema-transformed.xml
>> file-     /atom/src/config/generated-qbAclPlugin-schema.xml
>> file-     /atom/src/config/generated-qtAccessionPlugin-schema-transformed.xml
>> file-     /atom/src/config/generated-qbAclPlugin-schema-transformed.xml
>> file-     /atom/src/config/generated-qtAccessionPlugin-schema.xml
>> autoload  Resetting application autoloaders
>> autoload  Resetting CLI autoloader

Also available in: Atom PDF