Bug #13348

Fix PHP Warnings and Notices

Added by David Juhasz about 1 month ago. Updated 19 days ago.

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

0%

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

Description

Problem

The qa/2.6.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).

e.g.

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

Related to Access to Memory (AtoM) - Bug #13381: Elasticsearch error adding [metsData] to AIP document New 07/08/2020

History

#1 Updated by David Juhasz about 1 month ago

  • Subject changed from Fix PHP Warnings and Notices in AtoM 2.6 to Fix PHP Warnings and Notices in AtoM qa/2.6.x code

#2 Updated by David Juhasz about 1 month ago

I created a dev branch for this: https://github.com/artefactual/atom/tree/dev/issue-13348-fix-qa26x-warnings

But so far all of the warnings are from symfony vendor files. Maybe we should update to https://github.com/FriendsOfSymfony1/symfony1 instead?

#3 Updated by Dan Gillean 28 days ago

  • Target version deleted (Release 2.6.0)

#4 Updated by David Juhasz 26 days ago

I did a bit of research into updating our symfony vendor libraries to the latest https://github.com/FriendsOfSymfony1/symfony1 release, and I think it would be a pretty big job to upgrade. My conclusion is that upgrading they symfony vendor library isn't worth the effort to address warning and notices due to deprecations or other changes to syntax or libraries in PHP 7.2+. I think there *are( other reasons that it might be worthwhile to upgrade our symfony library, but I think it's overkill here.

#5 Updated by David Juhasz 26 days ago

  • Subject changed from Fix PHP Warnings and Notices in AtoM qa/2.6.x code to Fix PHP Warnings and Notices in AtoM

#6 Updated by David Juhasz 26 days ago

I merged PR 1148 to qa/2.6.x which fixes two incorrect variable names that raised warnings and had unintended consequences on functionality.

#7 Updated by David Juhasz 26 days ago

Holding PR 1153 for 2.6.1 which fixes a warning when saving an information object with no related PREMIS records.

#8 Updated by David Juhasz 26 days ago

  • Subject changed from Fix PHP Warnings and Notices in AtoM to Fix PHP Warnings and Notices

#9 Updated by Dan Gillean 26 days ago

  • Subject changed from Fix PHP Warnings and Notices to Fix PHP Warnings and Notices in AtoM
  • Target version set to Release 2.6.2

#10 Updated by Dan Gillean 26 days ago

  • Subject changed from Fix PHP Warnings and Notices in AtoM to Fix PHP Warnings and Notices

#11 Updated by David Juhasz 26 days ago

  • Related to Bug #13381: Elasticsearch error adding [metsData] to AIP document added

#12 Updated by David Juhasz 19 days ago

Now that 2.6.0 has been released, I've merged https://github.com/artefactual/atom/pull/1153 to the qa/2.x and stable/2.6.x branches.

#13 Updated by David Juhasz 19 days ago

  • Status changed from New to In progress

Also available in: Atom PDF