Problem/Motivation

Update lightning to 8.x-4.110 breaks compatibility with php < 7.3.

Patch https://www.drupal.org/files/issues/2869592-remove-update-warning-7.patch included in composer.json file since commit https://github.com/acquia/lightning/commit/26d2d7221c91234696e8e5f916c1e... lead to the following code in core/lib/Drupal/Core/Extension/ModuleExtensionList.php :

/**
   * {@inheritdoc}
   */
  protected function doScanExtensions() {
    return array_merge(
      parent::doScanExtensions(),
      $this->profileList->getList(),
    );
  }

Trailing commas for function calls are only available for php >= 7.3

Even if drupal recommandation is to use php 7.3, php 7.x version is still noted as supported by Drupal on https://www.drupal.org/docs/system-requirements/php-requirements

Steps to reproduce

Update lightning to version 8.x-4.110 with php < 7.3

Comments

ltonin created an issue. See original summary.

ltonin’s picture

Issue summary: View changes
phenaproxima’s picture

Well, shit. You are correct. I'll roll a bugfix release for this today.

  • phenaproxima committed 1929ec1 on 8.x-3.x
    Issue #3193991 by ltonin, phenaproxima: Lightning 8.x-4.110 breaks...

  • phenaproxima committed 35e9fba on 8.x-4.x
    Issue #3193991 by ltonin, phenaproxima: Lightning 8.x-4.110 breaks...
phenaproxima’s picture

Status: Active » Fixed

Fix committed and pushed. Releases forthcoming!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

isholgueras’s picture

Is this patch intended to be applied to 5. version?

In the Acquia servers, with PHP 7.3, we have this specific issue because acquia lightning composer.json is applying internally the patch
"REMOVE: Allow installation profile to be changed from Lightning during config sync": "https://www.drupal.org/files/issues/2021-01-08/3143958-10-change-profile..."
Instead of applying the patch from the comment #12 in this issue: https://www.drupal.org/node/3143958.

I know that this affects only php <= 7.2, and Druapl 9.1 requires php >= 7.3, but our cron jobs are broken because of this.

Acquia reports the php installed is 7.3.26 for both drush and /admin/status/report.

I can't find a way to fix it by myself with a patch. Any idea?

Thanks!

phenaproxima’s picture

I fixed this in Lightning and rolled new releases which include the corrected patch. If you update to 5.1.1, 8.x-4.111, or 8.x-3.410, it should be solved for you. Note that you do NOT need to change major versions; for example, if you're already using 8.x-4.something, you only need to update to 8.x-4.111. Same idea if you're using 8.x-3.x, or if you're using 5.1.x.

Let me know if it keeps happening, though!

jwilson3’s picture

Updating to Lightning 5.1.2 fixed the issue for us. Thanks

isholgueras’s picture

Thanks @phenaproxima, works perfect!