Repository navigation
PHP 7 Updates
Nancy Rackleff edited this page Feb 8, 2019
·
3 revisions
Mark modules that are not working with PHP 7.2 here
Note: Drupal 7 PHP 7.2 compatibility will be in 7.61. Release date was Nov 8.
Two modules that have PHP7 related issues that did not appear in our code compatibility tests
- https://www.drupal.org/project/search_api_solr/issues/2828473
- https://www.drupal.org/project/webform/issues/2811063 These are strange issues so I'm not surprised they are not showing up in our tests but it might be an argument to update all contrib modules to the latest versions. This could however result in other issues.
- Set your php version to 7.2
- Run all tests below and note any modules not part of drupal core (/includes and /modules) and not part of Pantheon (/misc) below in the Modules section.
- For each module, look through the issues on drupal.org to see if you can find an existing issue. One should exist in most cases. If so, see if an update to the stable version contains the fix, otherwise use a patch if available.
- After updating all the modules, run all the tests again to see if the issues are now gone.
composer global require wapmorgan/php-code-fixer dev-master-
phpcf --target=7.2 --file-extensions="php,module,inc,install,test" ~/Sites/givingforum- getting error:
Notice: Undefined offset: 1 in wapmorgan/php-code-fixer/data/mb_ereg_replace_e_modifier.php on line 11. Workaround by addingreturn false;to line 10 of that file.
- getting error:
composer global require sstalle/php7cc-
php7cc ~/Sites/givingforum --extensions="php,module,inc,install,test" --relative-paths --level=error- add
xdebug.max_nesting_level = 1000to /usr/local/etc/php/7.2/conf.d/php-ts.ini and do abrew services restart php72
- add
git clone git@github.com:Alexia/php7mar.git ~/Projects/php7marcd ~/Projects/php7mar-
php mar.php -f="~/Sites/givingforum" -x="php,module,inc,install,test" -t="critical"- Ignore the
each() function is deprecatederror.
- Ignore the
- Preferences > Languages & Frameworks > set PHP language level to 7.2.
- Code > Run Inspection by Name > Language Level.
Testing details will depend on the specific site we're working on but at minimum, rebuild the site, make sure pages of each content type load properly, check the Drupal logs for any issues. Try to test any functionality that uses any modules that have been updated.
- Change
php_versioninpantheon.ymlto7.1. - Update
drush_versioninpantheon.ymlto8.
- Drupal core
- includes/*
- modules/*
- misc/healthchecks | Issue
- This is Pantheon code. Likely won't impact the site.
- admin_menu | Issue
- should be fixed, try latest version or dev
- updated to 3.x-dev (bc712f72c4ce0d1152c86e6d3a7683b48cd0d062)
- apachesolr | Issue
- should be fixed, try latest version or dev
- updated to 1.11
- braintree library (not the commerce_braintree module)
- Fixed in 3.26.0, Drupal module ([commerce_braintree (https://www.drupal.org/project/commerce_braintree)) mentions it's tested on 3.21.0. No mention of PHP 7 compatibility or new library testing in issues. https://github.com/braintree/braintree_php
- context | Issue
- likely needs a patch
- added patch for stable version
- ctools | Issue
- should be fixed, try latest version or dev
- updated to 1.14
- diff | Issue Issue 2
- Likely needs a patch
- patched stable version
- features | Issue
- Likely needs a patch
- field_collection | issue
- patch available
- hacked | Issue
- should be fixed, try latest version
- metatag | Issue
- Function each() is deprecated.
- rules | Issue
- In 7.x-2.11
- views | Issue
- should be fixed, try latest version or dev
- views_bulk_operations | Issue
- Function create_function() is deprecated.
- Braintree library
- ValidationErrorCollectionTest.php:13 | Function create_function() is deprecated.
- Test code. There was a similar issue with production code which was fixed in 3.26.0
- ValidationErrorCollectionTest.php:13 | Function create_function() is deprecated.
- devel
- Division by zero is on purpose
- feeds
- libraries/http_request.inc:294 | Ini safe_mode is deprecated.
- This code checks for PHP version so safe_mode will not be used in deprecated versions.
- libraries/http_request.inc:294 | Ini safe_mode is deprecated.
- globalredirect
- globalredirect.test | Function usage assert() (@assert_on_string) is deprecated.
- Deprecated code is present in .test files. Should not run in production environment.
- globalredirect.test | Function usage assert() (@assert_on_string) is deprecated.