Bug #12568

atom-worker PHP 7.2 'create_function()' error message

Added by Steve Breker 6 months ago. Updated 24 days ago.

Status:VerifiedStart date:11/15/2018
Priority:LowDue date:
Assignee:-% Done:

0%

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

Description

When testing ticket 12004 effects on running Dockerized AtoM, the following PHP warnings were discovered when checking the logs.

See: http://php.net/manual/en/function.create-function.php
"This function has been DEPRECATED as of PHP 7.2.0. Relying on this function is highly discouraged."

Symfony and AtoM are making use of this function. Change to use PHP anonymous functions. See: https://stackoverflow.com/questions/48161526/php-7-2-function-create-function-is-deprecated

grepping the code for "create_function" in the 2.5 atom folder results in 35 hits in 25 files.

The copy of Symfony found here: https://github.com/FriendsOfSymfony1/symfony1/commits/master
... has been updated with all of these fixes and is listed as 7.2 compatible. This is the same version as what used to be here: https://github.com/LExpress/symfony1
I believe this is the same community supported version of Symfony that AtoM's is based on.

There is also use of this function in AtoM that will need to be changed.

atom steve$ docker-compose logs -f atom atom_worker nginx
Attaching to docker_nginx_1, docker_atom_1, docker_atom_worker_1
atom_1           | [14-Nov-2018 23:05:34] NOTICE: fpm is running, pid 15
atom_1           | [14-Nov-2018 23:05:34] NOTICE: ready to handle connections
atom_worker_1    | PHP Deprecated:  Function create_function() is deprecated in /atom/src/vendor/symfony/lib/config/sfConfigHandler.class.php on line 78
atom_worker_1    | Deprecated: Function create_function() is deprecated in /atom/src/vendor/symfony/lib/config/sfConfigHandler.class.php on line 78
atom_worker_1    | PHP Deprecated:  Function create_function() is deprecated in /atom/src/vendor/symfony/lib/config/sfConfigHandler.class.php on line 78
atom_worker_1    | Deprecated: Function create_function() is deprecated in /atom/src/vendor/symfony/lib/config/sfConfigHandler.class.php on line 78
atom_worker_1    | PHP Deprecated:  Function create_function() is deprecated in /atom/src/vendor/symfony/lib/config/sfConfigHandler.class.php on line 78
...

History

#1 Updated by José Raddaoui Marín 6 months ago

  • Priority changed from Medium to Low

#3 Updated by Mike Cantelon 2 months ago

  • Assignee set to Mike Cantelon

#4 Updated by Mike Cantelon 2 months ago

  • Status changed from Code Review to Feedback
  • Assignee changed from Mike Cantelon to Steve Breker

Looks good to me! Nice work!

#5 Updated by Steve Breker about 1 month ago

These commits apply fixes from the community maintained Symfony version
to remove and replace calls to 'create_function' since this function
is deprecated in PHP 7.2.

These changes affect:

  • vendor/symfony code
  • older migrations where this function was used
  • the i18n custom link to markdown CLI task

References for vendor/symfony code changes from community symfony project:
https://github.com/FriendsOfSymfony1/symfony1/pull/146
https://github.com/FriendsOfSymfony1/symfony1/pull/163
https://github.com/FriendsOfSymfony1/doctrine1/commit/7085ccf20b054eecde066f8a23a7e9c805f417c7#diff-fc589948371098da9ffc0958ab7057f0

Functionality should not be modified in any of these cases where create_function
has been removed.

#6 Updated by Steve Breker about 1 month ago

Merged to qa/2.5.x.

#7 Updated by Steve Breker about 1 month ago

  • Status changed from Feedback to QA/Review
  • Assignee deleted (Steve Breker)

#8 Updated by Corinne Rogers about 1 month ago

  • Status changed from QA/Review to In progress
  • Assignee set to Steve Breker

Tested today on 16.04 and 18.04:
Added the following to "Immediate source of acquisition or transfer" field, "Scope and content" field, and "Appriasal..." field here (https://atom25.1804.qa.accesstomemory.net/tree-frog-things/edit)

This is some <strong>bolded</strong> test, and this is some <em>italicized</em> text.

<ul><li>this</li><li>is</li><li>a</li><li>LIST!</li></ul>

<h2>this is a title!</h2>

this is my "custom link":https://www.accesstomemory.org

And this is my "custom email link":mailto:test@example.com

and then ran both tasks here: https://projects.artefactual.com/issues/12149#note-8

Neither task resulted in any change in the description.

#9 Updated by Corinne Rogers about 1 month ago

  • Status changed from In progress to Verified
  • Assignee deleted (Steve Breker)

ignore previous - analyst fail.

#10 Updated by Dan Gillean 24 days ago

  • Category set to Internals

Also available in: Atom PDF