Overview
- Update the site (dev, test, live) like normal. If it has been done recently do not worry about it.
- Create a multi-dev called php8
- Clone the site
- In ubuntu execute the command git checkout php8
- In SFTP download the required version of the modules
- Commit and switch to Git and then pull locally
- Patch required Modules
- Create Pantheon.yml file
- Patch Drupalexp theme as required
- Push, updb, cc all, and then test php8 site
- Troubleshoot as required
- Merge to Dev
- Update spreadsheet and celebrate
Update the Sites
- Go to the site's dashboard
- Bring the live database and files back to dev
- Backup, backup, backup
- Update core
- Once done, move the site to SFTP
- In the site admin, update all modules
- Run update.php
- Clear the site's cache
- Verify all is well
- Commit the code changes
- Open your bash
- Pull down the changes
Begin PHP8 Upgrade
- Create a multi-dev and call it php8
- Clone the site
- In ubuntu execute the command git checkout php8
- ULI into the new multi-dev: terminus drush site-name.php8 -- uli
- Check the site for the modules in the Modules list below
- Swap to troublesome modules to dev and patch if necessary
- This can be done locally or through Terminus and Drush
- Locally is downloading, extracting and replacing
- Through Terminus and Drush can be done in a few steps
- Make sure the site is still in SFTP
- In your bash run this for each module
- terminus drush site-name.site-env -- dl module_name-module_version -y
- ex. terminus drush ofm-ofm.php-8 -- dl security_review-7.x-1.x-dev -y
- Once done with all modules, run a database update and cache clear
- Commit changes
- Put the site back into Git
- Do a Git Pull to Pull down the changes
- The terminus drush -- dl command will put the dl module into a modules>contrib folder if there is a contrib folder. Check to make sure you now do not have duplicated modules. If you have a module you just downloaded and patched in contrib make sure to delete the duplicate folder that is directly in the modules folder.
- Patch those troublesome modules
- Check for pantheon.yml in the site root
- if it's not present, make the file name it "pantheon.yml"
- Just add these 2 lines
api_version: 1
php_version: 8.0
- Check to see if the website has drupalexp as a theme in the sites/all/themes folder. If it does go to the bottom of this page and apply the drupalexp patch. If not, or once complete with the patch, proceed to the next step.
- Push the changes up
- Run these commands in bash
- terminus drush site-name.site-env -- cc all
- terminus drush site-name.site-env -- updb -y
- Verify that all is well
- If any other modules present deprecated code issues, the first place to look is the module's issue log
- Merge php8 into dev (make sure "Run update.php" is checked)
- Once dev is good, a simple code push, database update and cache clear should be all that's needed
Steps to Patch a Module
All the patches can be pulled from a repository that we manage. Those patches can be cloned with the bash command below. The folder can live outside the site root folder like so.
- Root
- site folder
- site files
- patches
- list of patches
- site folder
git clone git@gitlab.com:watech-web/d7-php8-patches.git patches
or
git clone https://gitlab.com/watech-web/d7-php8-patches.git patches
Every so often, CD into the patches folder and run a git pull.
- If not open, then open your bash
- cd into a site folder
- Determine what modules in the list below are used on the site
- Once done with all, cd into each module's folder
- cd sites/all/modules/module-name
- Copy the patch file from patches to the module folder
- cp -rf ../../../../../patches/patch-name.patch .
- Keep track of the ../ as you may be one folder deeper in modules like in contrib
- Verify the patch file exists
- ls
- Apply the patch
- patch -p1 < patch-name.patch
- Verify you see a success message
- Remove the patch file in the module folder
- rm -rf patch-name.patch
- Repeat for every module that needs to be patched
Module List
The following modules have issues with PHP 8. Some are fixed in dev releases and the rest need to have the dev release patched. There's a good possibility the dev release could be fixed soon. Each module below has the download link for the code, the issue link and the patch link. Check the issue link to see if it has been marked 'fixed.' If so, just download the dev release.
Download Dev Only
Context
- Dev: https://ftp.drupal.org/files/projects/context-7.x-3.x-dev.tar.gz
- Terminus download: terminus drush site-name.site-env -- dl context-7.x-3.x-dev -y
Date
- Dev: https://ftp.drupal.org/files/projects/date-7.x-3.x-dev.tar.gz
- Terminus download: terminus drush site-name.site-env -- dl date-7.x-3.x-dev -y
Feeds (fixed in dev as of 11/3/2022)
- Dev: https://www.drupal.org/files/projects/feeds-7.x-2.x-dev.tar.gz
- Terminus download: terminus drush site-name.site-env -- dl feeds-7.x-2.x-dev -y
- Issue: https://www.drupal.org/project/feeds/issues/3254188
- Patch: https://www.drupal.org/files/issues/2022-08-03/3254188-feeds-php-8-compatibility-17.patch
SMTP
- Terminus download: terminus drush site-name.env -- dl smtp-7.x-1.x-dev -y
Needs Dev and Patch
CKEditor Link
- Dev: https://ftp.drupal.org/files/projects/ckeditor_link-7.x-2.x-dev.tar.gz
- Terminus download: terminus drush site-name.site-env -- dl ckeditor_link-7.x-2.x-dev -y
- Issue: https://www.drupal.org/project/ckeditor_link/issues/3209681
- Patch: https://www.drupal.org/files/issues/2021-04-20/ckeditor_link-optional-parameter-3209681-2.patch
Entity Reference Autocomplete
- Dev: https://www.drupal.org/project/entityreference_autocomplete/releases/7.x-1.x-dev
- Terminus download: terminus drush site-name.site-env -- dl entityreference_autocomplete-7.x-1.x-dev -y
- Issue: https://www.drupal.org/project/entityreference_autocomplete/issues/3295289
- Patch: https://www.drupal.org/files/issues/2022-09-08/fix_php8_deprecations-3295289-5.patch
Features Extra
- Dev: https://www.drupal.org/project/features_extra/releases/7.x-1.x-dev
- Terminus download: terminus drush site-name.site-env -- dl features_extra-7.x-1.x-dev -y
- Issue: https://www.drupal.org/project/features_extra/issues/3256320
- Patch: https://www.drupal.org/files/issues/2022-08-06/3256320-features_extra-php-8-compatibility-7.patch
Hierarchical Select
- Dev: https://ftp.drupal.org/files/projects/hierarchical_select-7.x-3.x-dev.tar.gz
- Terminus download: terminus drush site-name.site-env -- dl hierarchical_select-7.x-3.x-dev -y
- Issue: https://www.drupal.org/project/hierarchical_select/issues/3277847
- Patch: https://www.drupal.org/files/issues/2022-04-29/hierarchical_select-php8.patch
- Comments. The patch from the watech repository broke the menu function on goia. Pages could not be saved in the menu. The patch listed above worked fine.
- Issue: to fix the hs_menu line 219 error. https://www.drupal.org/project/hierarchical_select/issues/3171539
- Patch: https://www.drupal.org/files/issues/2020-09-17/php7.4-access-array-offset-null-type-3171539.patch
Location
- Dev: ?
- Teminus download: ?
- Issue: https://www.drupal.org/project/issues/location?categories=1
- Patch: https://www.drupal.org/files/issues/2020-03-06/location-php-7.4.patch
Multiupload Filefield Widget
- Dev: https://ftp.drupal.org/files/projects/multiupload_filefield_widget-7.x-1.x-dev.tar.gz
- Terminus download: terminus drush site-name.site-env -- dl multiupload_filefield_widget-7.x-1.x-dev -y
- Issue: https://www.drupal.org/project/multiupload_filefield_widget/issues/3254703
- Patch: https://www.drupal.org/files/issues/2022-05-05/3254703-5.patch
Oauth
- Dev: https://ftp.drupal.org/files/projects/oauth-7.x-3.x-dev.tar.gz
- Terminus download: terminus drush site-name.site-env -- dl oauth-7.x-3.x-dev -y
- Issue: https://www.drupal.org/project/oauth/issues/3117903
- Patch: https://www.drupal.org/files/issues/2020-03-05/oauth-php-7.4.patch
Path Breadcrumbs
- Dev: https://ftp.drupal.org/files/projects/path_breadcrumbs-7.x-3.x-dev.tar.gz
- Terminus download: terminus drush site-name.site-env -- dl path_breadcrumbs-7.x-3.x-dev -y
- Issue: https://www.drupal.org/project/path_breadcrumbs/issues/3277689
- Patch: https://www.drupal.org/files/issues/2022-04-28/path_breadcrumbs-php8.patch
Security Review
- Dev download: https://www.drupal.org/files/projects/security_review-7.x-1.x-dev.tar.gz
- Terminus download: terminus drush site-name.site-env -- dl security_review-7.x-1.x-dev -y
- Issue: https://www.drupal.org/project/security_review/issues/3277849
- Patch: https://www.drupal.org/files/issues/2022-04-29/security_review-php8.patch
Workbench Moderation
- Dev: https://www.drupal.org/project/workbench_moderation/releases/7.x-3.x-dev
- Terminus download: terminus drush site-name.site-env -- dl workbench_moderation-7.x-3.x-dev -y
- Issue: https://www.drupal.org/project/workbench_moderation/issues/3259574
- Patch: https://www.drupal.org/files/issues/2022-01-20/workbench_moderation-3259574-php-8.0-compatibility.patch
Steps to Update Drupalexp Theme
- cd sites/all/themes/drupalexp
- run wget https://gitlab.com/watech-web/drupalexp-php-8/-/raw/main/drupalexp-lessc-curly-fix.patch
- If it does not work email Sam to get a copy of the patch and copy it into drupalexp folder.
- In bash run
- find . -type f -print0 | xargs -0 dos2unix
- Now run
- patch -p1 -l < drupalexp-lessc-curly-fix.patch
- Remove the patch file (and patch identifier) from the drupalexp folder.
- rm -rf drupalexp-lessc-curly-fix.patch
- rm -rf drupalexp-lessc-curly-fix.patch\:Zone.Identifier
- CD back to the root of the site
- Send the changes up
If the find command (4) does not work you may need to install dos2unix. sudo apt-get install dos2unix
Notes:
DB Mega - D7
Not a standard patch, but a clone.
https://gitlab.com/watech-web/db-mega-d7
- cd sites/all/modules
- Could be in contrib too
- rm -rf db_megamenu
- git clone git@gitlab.com:watech-web/db-mega-d7.git db_megamenu
- or git clone https://gitlab.com/watech-web/db-mega-d7.git db_megamenu
- rm -rf .git
- cd back to root
- send the changes up
TB MegaMenu
- cd sites/all/modules
- could be in contrib
- rm -rf tb_megamenu
- git clone https://git.drupalcode.org/project/tb_megamenu.git
- cd tb_megamenu
- git checkout 7.x-1.x
- rm -rf .git
- cd back to root
- send up
- updb and cc all
- test
If there is still an issue:
"Warning: Trying to access array offset on value of type null in tb_megamenu_sync_config() (line 370 of /code/sites/all/modules/tb_megamenu/tb_megamenu.functions.inc)."
You can look at Issues for tb_megamenu and find this patch.
https://www.drupal.org/files/issues/2023-03-04/tb_megamenu-php_notice_fixes-3211791-9.patch
To apply this complicated patch following this instructions.
SAML Library (php-saml)
There is an error that the older version of the library throws. It is:
Deprecated function: Function libxml_disable_entity_loader() is deprecated in OneLogin\Saml2\Utils::validateXML() (line 146 of /code/sites/all/libraries/php-saml/src/Saml2/Utils.php).
It does not currently appear to hinder someone's ability to login using the active directory, but it is a php error. To fix that we need to replace the current directory with the 3x-dev branch. To do this follow these steps starting in the website's folder.
- cd sites/all/libraries
- rm -rf php-saml
- git clone https://github.com/SAML-Toolkits/php-saml.git php-saml
- cd php-saml
- git checkout 3.x-dev
- rm -rf .git
- cd back to root
- send the changes up
IP Geolocation
Picture
Nodeformcols