Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When installing Drupal module metatag version: '8.x-1.19' module, the sub module metatag_extended_perms gets created twice, once inside a folder named b #514

Closed
5 tasks done
saurabhtripathi opened this issue Jun 7, 2023 · 5 comments
Labels
bug Inconsistencies or issues which will cause a problem for users or implementors.

Comments

@saurabhtripathi
Copy link

Verification

  • I have updated Composer to the most recent stable release (composer self-update)
  • I have updated Composer Patches to the most recent stable release (composer update cweagans/composer-patches)
  • I am using one of the supported PHP versions (8.0+)
  • I have searched existing issues and discussions for my problem.
  • My problem is not addressed in the troubleshooting guide.

What were you trying to do (and why)?

When installing metatag version: '8.x-1.19' module, the sub module metatag_extended_perms gets created twice,
once inside a folder named b

What happened? What did you expect to happen?

Steps to reproduce
Install "drupal/metatag": "1.19.0" via composer, run composer install

Contents of composer.json

Proposed resolution
This appears to be an issue of composer itself, , for patches like https://www.drupal.org/files/issues/2020-01-17/metatag-n2782797-25.patch , there are old issues reported in composer for this like https://github.com/cweagans/composer-patches/issues/199 , so any patch which tries creating new directories creates with a b/ prefix.

 "drupal/metatag": "1.19.0",

  "drupal/metatag": {
                "Permission for each meta tag field in forms": "https://www.drupal.org/files/issues/2020-01-17/metatag-n2782797-25.patch"
            },

  "drupal/metatag": {
        "3057523 - Load metatags asynchronously": "https://www.drupal.org/files/issues/2022-01-25/3057523-72-metatag-async-click-trigger-accessibility.patch"
      }

Contents of patches.lock.json

"drupal/metatag": {
        "3057523 - Load metatags asynchronously": "https://www.drupal.org/files/issues/2022-01-25/3057523-72-metatag-async-click-trigger-accessibility.patch"
      }

Full output of composer patches-doctor

"drupal/metatag": {
        "3057523 - Load metatags asynchronously": "https://www.drupal.org/files/issues/2022-01-25/3057523-72-metatag-async-click-trigger-accessibility.patch"
      }

Full output of relevant Composer command with the -vvv flag added

"drupal/metatag": {
        "3057523 - Load metatags asynchronously": "https://www.drupal.org/files/issues/2022-01-25/3057523-72-metatag-async-click-trigger-accessibility.patch"
      }
@saurabhtripathi saurabhtripathi added the bug Inconsistencies or issues which will cause a problem for users or implementors. label Jun 7, 2023
@timohuisman
Copy link

Can you post your full composer.json configuration? If I remember it correctly, you can resolve this issue with the patchLevel setting from composer-patches.

    "patchLevel": {
      "drupal/core": "-p2"
    },

@tgoeg
Copy link

tgoeg commented Sep 21, 2023

Yes.
I consider this to be a bug?
It happens for all patches creating new files, independent of the package.
As there is no file to anchor the patch on, it gets created with every iteration of patch -p0 till -p4.
The mentioned workaround fixes it, but I don't really feel that's a proper permanent solution.
I'd prefer the process to fail when anchoring is impossible because of new files, stating a patch parameter has to be given.

@cweagans
Copy link
Owner

Composer Patches 2.x doesn't guess patch levels anymore, so this shouldn't happen. Please upgrade and give it a try.

drupal/core already has special handling in 2.x as well, so you shouldn't have to configure anything to get the right patch depth.

@tgoeg
Copy link

tgoeg commented Oct 24, 2023

Alright, I can update, then.
It's just that https://www.drupal.org/docs/develop/using-composer/preparing-your-site-for-composer-2 says ^1.7 and that's what sticked since the upgrade to composer 2.
Should the compatibility somehow be reflected in drupal/core as a recommendation or similar, so users install ^2.0 ?

@cweagans
Copy link
Owner

2.x is still a beta release, but probably should update the docs when 2.0.0 is tagged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Inconsistencies or issues which will cause a problem for users or implementors.
Projects
None yet
Development

No branches or pull requests

4 participants