Closed (fixed)
Project:
Drupal voor Gemeenten
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Jul 2018 at 08:10 UTC
Updated:
3 Apr 2019 at 09:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
chansorpea@ezcompany.nl commentedThe patch above applies a patch that replaces
count()function withempty()function and adds if-statement withis_array()function before calling thecount()function.These changes are made on some necessary core files, not on all core files.
Comment #3
chansorpea@ezcompany.nl commentedPatch #3 applies more patches to fix other deprecated functions on PHP 7.2 as well such as:
[PHP 7.2] create_function() is deprecated
Function each() is deprecated since PHP 7.2
Unable to update modules due to Archive_Tar incompatibility with PHP 7.2
Replacing
count()function byempty()is also included.Comment #4
chansorpea@ezcompany.nl commentedPatch #3 includes the following patches which might be duplicated. This leads to fail applying patch
2947772-31.patchprojects[drupal][patch][] = "https://www.drupal.org/files/issues/2018-04-21/drupal-7-count-function-d..."
projects[drupal][patch][] = "https://www.drupal.org/files/issues/2018-05-15/drupal-7-php-7-2-2947772-..."
Patch
2885610-19.patchis also included in2947772-31.patchSee Fully support PHP 7.2 in Drupal 7
Thus, patch #4 applies only two patches which includes everything needed.
Comment #5
paulvandenburg commentedLooks good!
I've not marked it tested though, because I'll wait until we've done some more extensive testing on the staging environment we've prepared for this.
Comment #6
Danny.Wouters commentedI think there will be a D7 release soon to fix compatibility with PHP 7.2 because a lot of patches are recently committed in the dev branch.
I created a new patch for dvg with the PHP 7.2 patches we are using on production sites for several months now.
Comment #7
Danny.Wouters commentedI rerolled the previous patch against the current dev-branch and added PHP 7.2 patches for contrib modules (admin_menu and features)
Comment #8
paulvandenburg commentedBy removing the #2947772: Fully support PHP 7.2 in Drupal 7 patch we were also missing some php7.2 fixes for core.
But instead of readding that patch I've added the few missing patches that have been committed to the core 7.x-dev branch to fix php7.2 compatibility.
I've verified the other core patches match those already committed to core.
The contrib patches look good.
Comment #9
paulvandenburg commentedCame across another php7.2 incompatibility in webform this time.
It is already fixed and committed to webform in this issue: #2953662: Only use count() on countables.
I've added that fix to this patch as well.
Comment #10
paulvandenburg commentedI've found 2 more issues in contrib modules. However those 2 might need some work on the contrib part.
field_collection: #2936874: PHP7.2 - Deprecated function: each()
The patch does not apply on the field_collection version currently used in DvG.
The error, occurring when creating a simple basic page:
Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in FieldCollectionItemEntity->fetchHostDetails() (line 422 of /<project>/profiles/dvg/modules/contrib/field_collection/field_collection.module).adminimal_theme: #2951412: Warning notice in php 7.2
The patch might need work, although it currently does solve the issue.
The error, when visiting admin pages like watchdog logs:
Warning: count(): Parameter must be an array or an object that implements Countable in adminimal_table() (line 400 of /<project>/profiles/dvg/themes/adminimal_theme/template.php).Comment #12
paulvandenburg commentedAfter some internal discussion with Danny.Wouters we've concluded it is best to commit #9 to start making some progress on php7.2 compatibility.
The mentioned fixes for field_collection and adminimal_theme can be added at a later time.
Comment #13
paulvandenburg commentedBoth known and mentioned patches are fixed in those 2 projects. So we can now update our versions of those modules to include the patches:
For field_collection we can update to 7.x-1.0-beta13
For adminimal_theme we can update to 7.x-1.25
Comment #14
joshahubbers commentedNice! Looks good and works.
Comment #15
joshahubbers commentedComment #17
paulvandenburg commented