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

Bug: As of WordPress 6.0, composer-patches on roots/wordpress does not work anymore #424

Open
5 tasks done
drzraf opened this issue Aug 24, 2022 · 2 comments
Open
5 tasks done
Labels

Comments

@drzraf
Copy link

drzraf commented Aug 24, 2022

Terms

Description

What's wrong?

Can't patch roots/wordpress anymore.

What insights have you gained?

https://github.com/cweagans/composer-patches/blob/e9969cfc0796e6dea9b4e52f77f18e1065212871/src/Patches.php#L304

$install_path = $manager->getInstaller($package->getType())->getInstallPath($package);
now returns an empty string.

Possible solutions

Use roots/wordpress-no-content (in require and extra.patches

Temporary workarounds

Amend documentation / warn.

Steps To Reproduce

    "extra": {
        "patches": {
            "roots/wordpress-no-content": {
                "foo": "https://core.trac.wordpress.org/raw-attachment/ticket/bar.patch",
        }
    }
}

Expected Behavior

Installing and patching succeed

Actual Behavior

Executing command (CWD): patch '-p1' --no-backup-if-mismatch -d '' < '/tmp/63058d0222de6.patch'
patch: **** Can't change to directory '' : No such file or directory

Relevant Log Output

No response

Versions

6.0

@drzraf drzraf added the bug label Aug 24, 2022
@retlehs retlehs transferred this issue from roots/wordpress Aug 24, 2022
@swalkinshaw
Copy link
Member

roots/wordpress is now a metapackage which might explain this. I found cweagans/composer-patches#280

If you're using roots/wordpress-no-content or roots/wordpress-full then I'm assuming it should still work. And we do recommend you switch to one of those more explicit packages.

@montchr
Copy link

montchr commented Mar 13, 2023

And we do recommend you switch to one of those more explicit packages.

Bedrock is still using the roots/wordpress package, but I haven't run across this issue using that package. Does the issue only affect certain versions of WordPress or has it been fixed elsewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants