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

balsama created an issue. See original summary.

balsama’s picture

Issue summary: View changes
josephdpurcell’s picture

Upgrading 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:

  - 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


  [Exception]
  Cannot apply patch 2955065 - Customized layout does not display for node with customizations enabled when using full content view mode (https://www.drupal.org/files/issues/2019-03-25/2955065-25.patch)!

I then did the workaround:

$ composer require drupal/lightning_layout:~2.0.0 --no-update
$ composer update

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.

jasonawant’s picture

Hi 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

balsama’s picture

Issue summary: View changes
josephdpurcell’s picture

Thanks @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 the drupal/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.

josephdpurcell’s picture

When 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.

josephdpurcell’s picture

I just went to upgrade from 4.0.0 to 4.0.3 and ran into this error:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: remove drupal/lightning_layout 2.0.0
    - Installation request for acquia/lightning ~4.0.4 -> satisfiable by acquia/lightning[4.0.4].
    - Conclusion: don't install drupal/lightning_layout 2.0.0
    - Conclusion: don't install drupal/lightning_layout 2.0.0
    - acquia/lightning 4.0.4 requires drupal/lightning_layout ^2.1 -> satisfiable by drupal/lightning_layout[2.x-dev].
    - Can only install one of: drupal/lightning_layout[2.x-dev, 2.0.0].
    - Can only install one of: drupal/lightning_layout[2.x-dev, 2.0.0].
    - Installation request for drupal/lightning_layout 2.0.0 -> satisfiable by drupal/lightning_layout[2.0.0].

After removing this line from my composer.json I was able to proceed:

-        "drupal/lightning_layout": "2.0.0",

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?

balsama’s picture

Status: Active » Fixed

The original problem is no longer an issue now that 2.1 is out.

Status: Fixed » Closed (fixed)

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