I'm trying, for the first time, to add a patch in composer.json, for a layout builder issue (https://www.drupal.org/project/drupal/issues/3045171#comment-13450756).

It's the first time I do it, I see that after using the patch composer creates a "b" directory in inside the "core" directory.

The question is: when I'll upgrade the core version what should I do, if the patch will be include in the next release? Remove patch from composer.json? And what about that "b" directory?

I've added this code in the "extra" section of my composer.json and before I've installed the cweagans/composer-patches plugin, with composer:

"patches": {
  "drupal/core": {
    "#3045171-140: Forms break Layout Builder saving.": "https://www.drupal.org/files/issues/2020-02-04/layout-builder-save-issue-3045171-140.patch"
"enable-patching": true

Once you removed the patch from composer.json and run updates, core directory will be overridden by the new release and here the "b" directory will be removed.

For best practices reasons, I invite you to manage your project patches using composer patches plugin, and to be more specific use external patch file method.

  • Thanks, I'm using that plugin, the doubt was about che "b" directory
    – arrubiu
    May 17 '20 at 14:51
  • Normally by using the plugin you should have no "b" directory, can you share the json file content in which you added the patch?
    – MiharbKH
    May 17 '20 at 14:58
  • Yes, I've updated my question
    – arrubiu
    May 17 '20 at 15:07
  • Try to use external patch file to be more organized see: github.com/cweagans/…
    – MiharbKH
    May 17 '20 at 15:14
  • 1
    Thanks, this is a better way, worked for me :)
    – arrubiu
    May 17 '20 at 17:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.