When creating a new codebase or updating from 3.2.x/3.3.x the profile tends to prefer the alpha12 release of Lightning Layout 2.x over the stable 2.0.0 tag. The result is that the patch from #2955065: Customized layout does not display for node with customizations enabled when using full content view mode provided by the alpha no longer applies:
- Applying patches for drupal/core
https://www.drupal.org/files/issues/2869592-remove-update-warning-7.patch (2869592 - Disabled update module shouldn't produce a status report warning)
https://www.drupal.org/files/issues/2885441-2.patch (2885441 - EntityReferenceAutocompleteWidget should define its size setting as an integer)
https://www.drupal.org/files/issues/2019-03-05/2815221-116.patch (2815221 - Add quickedit to the latest-revision route)
https://www.drupal.org/files/issues/2018-10-12/1356276-531.patch (1356276 - Allow profiles to define a base/parent profile and load them in the correct order)
https://www.drupal.org/files/issues/2018-07-09/2914389-8-do-not-test.patch (2914389 - Allow profiles to exclude dependencies of their parent)
https://www.drupal.org/files/issues/2019-03-25/2955065-25.patch (2955065 - Customized layout does not display for node with customizations enabled when using full content view mode)
Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2019-03-25/2955065-25.patch
We have anecdotal reports of this happening plus a CI build where it happened consitently. I also just saw it on a routine update from 3.2.6.
I think this is because the dependencies changed quite a bit between those releases, although I'm not sure what specifically. Perhaps the addition of Panels, Panelizer, and CTools in the stable makes Composer prefer the alpha?
alpha12 dependencies:
"require": {
"cweagans/composer-patches": "^1.6.4",
"drupal-composer/drupal-scaffold": "^2.0.0",
"drupal/bg_image_formatter": "^1.2",
"drupal/entity_block": "^1.0",
"drupal/entity_browser_block": "^1.0",
"drupal/layout_builder_restrictions": "^1.5",
"drupal/layout_library": "1.0-alpha2",
"drupal/lightning_core": "^4.0-beta1",
"drupal/simple_gmap": "^1.4",
"oomphinc/composer-installers-extender": "^1.1"
},
2.0.0 dependencies:
"require": {
"cweagans/composer-patches": "^1.6.4",
"drupal-composer/drupal-scaffold": "^2.0.0",
"drupal/bg_image_formatter": "^1.2",
"drupal/ctools": "3.0",
"drupal/entity_block": "^1.0",
"drupal/entity_browser_block": "^1.0",
"drupal/layout_builder_restrictions": "^1.5",
"drupal/layout_library": "1.0-alpha2",
"drupal/lightning_core": "^4.1",
"drupal/panelizer": "^4.1",
"drupal/panels": "4.3",
"drupal/simple_gmap": "^1.4",
"oomphinc/composer-installers-extender": "^1.1"
},
Proposed resolution
I'm not sure what the resolution here could be. We can't delete the alpha releases (without bothering someone with special D.O privileges at least). We're not going to drop the additoinal dependencies. Perhaps we need to make the profile explicitly conflict with anything below stable (the @stable
tag obviously isn't enough).
Workaround
The workaround is to explicitly require the 2.0.0 version of Lightning Layout in your root composer.json file:
$ composer require drupal/lightning_layout:~2.0.0 --no-update
$ composer update
Or you could use Lightning Strict to pin all dependencies:
$ composer require acquia/lightning:~4.0.0 balsama/lightning_strict:~4.0.0 --no-update
$ composer update
Comments
Comment #2
balsamaComment #3
josephdpurcell CreditAttribution: josephdpurcell at Bounteous commentedUpgrading from acquia/lightning:4.0.0-beta2 to acquia/lightning:4.0.0 cause an issue described in this ticket. The error was a bit flighty and hard to predict, I tried clearing composer cache, deleting the installed directories and re-installing, and other tricks. The exact error that kept popping up was:
I then did the workaround:
And now I can upgrade to 4.0.0.
Can someone confirm if there are any negative side effects of doing this? At present, I only know that it allowed composer to successfully install. I've not yet tested any of the Lightning functionality to see if this workaround broke something.
Comment #4
jasonawantHi josephdpurcell,
I'm wondering if you can now remove the required drupal/lightning_layout:2.0.0 from your project's composer.json and install without issue. I would want to remove this requirement and let acquia/lightning and drupal/lightning_core manage this dependency instead of the project. Jason
Comment #5
balsamaComment #6
josephdpurcell CreditAttribution: josephdpurcell at Bounteous commentedThanks @jasonawant. That sounds correct -- I add the
drupal/lightning_layout:~2.0.0
, run composer update, and then since the lock file is updated at this point I could remove thedrupal/lightning_layout:~2.0.0
.However, because I don't know what updates or changes might be coming, or if someone might need to wipe the composer.lock file (for whatever reason), I want to leave this line there as a guarantee until there is a permanent fix.
Comment #7
josephdpurcell CreditAttribution: josephdpurcell at Bounteous commentedWhen I ran
drupal/lightning_layout:~2.0.0
it failed with the same error described in this ticket.When I ran
drupal/lightning_layout:2.0.0
(no tilde) it worked correctly.Comment #8
josephdpurcell CreditAttribution: josephdpurcell at Bounteous commentedI just went to upgrade from 4.0.0 to 4.0.3 and ran into this error:
After removing this line from my composer.json I was able to proceed:
It's important to note that I was using "2.0.0" without the tilde.
I wonder if this ticket, then, is limited to being an issue with only 4.0.0?
Comment #9
balsamaThe original problem is no longer an issue now that 2.1 is out.