atom
atom copied to clipboard
PHP error, warnings and notices when using qubit_dev.php
Current Behavior
The following is observed when accessing qubit_dev.php on AtoM instances version 2.7.0 and upwards:
2024/01/11 13:21:02 [error] 299886
#299886: *8 FastCGI sent in stderr:
PHP message:
PHP Notice:
Trying to access array offset on value of type bool in /var/www/test.archivemax.gr/html/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/Propel.php
http://test.archivemax.gr/html/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/Propel.php on line 666
PHP message:
PHP Warning:
ini_set(): A session is active. You cannot change the session module's ini settings at this time in /var/www/[test.archivemax.gr/html/vendor/symfony/lib/user/sfBasicSecurityUser.class.php
http://test.archivemax.gr/html/vendor/symfony/lib/user/sfBasicSecurityUser.class.php on line 257
PHP message:
PHP Notice:
Trying to access array offset on value of type bool in /var/www/[test.archivemax.gr/html/lib/model/QubitMenu.php
http://test.archivemax.gr/html/lib/model/QubitMenu.php on line 465
followed by an endless repeat of the last PHP message above.
Expected Behavior
As these instances are either deployed directly from Github or installed using the official stable release packages without any further modifications after that, the qubit_dev.php functionality should work without throwing a PHP error, warnings or notices out of the box, as it did in earlier versions.
Possible Solution
No response
Context and Notes
No response
Version used
AtoM 2.7.0 or newer (2.7.1, 2.7.2, 2.7.3, 2.8.0)
Operating System and version
Ubuntu 20.04
Default installation culture
en, el
PHP version
PHP 7.4
Contact details
No response
Is there any chance this functionality could be restored to a working state in 2.8.1?
Also, does the AtoM Maintenance team run any additional debugging environment we could replicate in order to facilitate our work on AtoM plugins, integrations and so on?
Note: As reported on the related thread in the user forum (from 2024-01-30), @adaxem is also seeing this behavior when running the cache:clear task. See:
- https://groups.google.com/g/ica-atom-users/c/xF7jHej8MYQ/m/GOF2192fAAAJ
I confirm this behavior occurs when accessing qubit_dev.php. Tested on a brand new and clean 2.8.0 install from tar release:
Notice: Trying to access array offset on value of type bool in /usr/share/nginx/atom/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/Propel.php on line 666
Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in /usr/share/nginx/atom/vendor/symfony/lib/user/sfBasicSecurityUser.class.php on line 257
Notice: Trying to access array offset on value of type bool in /usr/share/nginx/atom/lib/model/QubitMenu.php on line 465
Notice: Trying to access array offset on value of type bool in /usr/share/nginx/atom/lib/model/QubitMenu.php on line 466
Notice: Trying to access array offset on value of type null in /usr/share/nginx/atom/vendor/symfony/lib/form/sfForm.class.php on line 929
Notice: Trying to get property 'id' of non-object in /usr/share/nginx/atom/plugins/qbAclPlugin/lib/QubitAcl.class.php on line 749
This seems to be related to a backward incompatible change introduced on PHP 7.4 (see https://www.php.net/manual/en/migration74.incompatible.php and https://wiki.php.net/rfc/notice-for-non-valid-array-container). AtoM 2.6 install guide has instructions for installing PHP 7.2. Maybe that's why this problem didn't exist back then.
Anything that can be done to address this? Any workarounds?
Also, if there is information about your own internal debugging environment for AtoM development that you can share (here or privately), this would help us in a big way while this is being looked at.
Hi @adaxem! Thank you so much for bringing this issue to our attention!
I've been investigating this, and its fix is linked to a few php upgrade related changes that we have planned for AtoM 2.9. The 2.8.1 release will be a minor release with a few small bug fixes that we've already identified and fixed in AtoM in our qa branch, and the 2.9 release will address breaking changes introduced in PHP 8.0, which will also address a lot of deprecation notices and warnings that show up in the dev mode.
If you wish, we can update this thread and point you to a commit once we have the relevant commit ready if you don't want to wait for the release. As for how we're currently getting debugging information, we usually refer to logs. We use docker containers for our development environment (AtoM Dev Manual - Docker compose environment), and getting the relevant error messages/warnings just involves running docker compose logs --follow atom
(for AtoM UI specific messages), docker compose logs --follow atom_worker
(for CLI tasks or jobs run through gearman), or docker compose logs --follow nginx
(for web server related messages). Hopefully this would be helpful for development purposes!
Also @adaxem, if you prefer to use Symfony UI for debugging and aren't working on building a new theme, there's another potential solution for the time being that might work for you. While Bootstrap 2 themes have been deprecated, they're still present in AtoM 2.8.0, and using the arDominionPlugin
theme while in dev mode doesn't seem to trigger the same issues for me, so switching themes could be another potential workaround.
Thank you for this information @anvit ππ» And thank you for the investigation @marceloalencar π«Άπ»
Yes, pointing us to a commit once this issue is addressed, even before a release, would be very helpful.