-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
Patch for new file applied to incorrect location #43
Comments
Can you please provide a complete composer.json file that will allow me to reproduce the problem? |
We ran into the same issue:
The issue is that as
This means that if a patch modifies a file Are there any workarounds for this? |
Not presently, I'm afraid. 2.x will give you the ability to manually set your p value, though, so this issue would go away. I'm hoping to have a beta out the door this weekend, but that may change depending on some other things that are going on. |
Seeing this again on another migrate process plugin patch. The namespace is migrate, because that is where the plugins exist. But the module it should be applied to is migrate_plus, not core migrate. Did any functionality for 2.x ever get contributed? |
It looks like it's only happening on patches that only include new files without and file change (change on permissions are working). How can it work so well when there is at least one changed file in the patch? |
Patching "drupal/core" requires -p2 because the package root is the "core" subfolder of the Drupal repo. |
Came across this issue as well with a migrate process plugin. |
Here's a workaround for anyone else running into this with a Drupal core patch. Just copy the patch to local storage and modify it to remove "core/" from the patch lines (this allows the patch to apply properly with -p1). |
With this it should be not too difficult to massage the patch: |
After upgrading to the latest ( Swapping the patch levels to run |
- Reroll of cweagans#101 - Fixes cweagans#43
- Reroll of cweagans#101 - Fixes cweagans#43
- Backport to `1.x` - Reroll of cweagans#101 - Fixes cweagans#43
@jhedstrom Do you have a sample core patch that's failing in the manner you described? My project uses many Drupal core patches but I believe most of them modify other files in addition to adding new ones. I have composer-patches 1.6.4, Git version 2.16.1, and patch version 2.7.5. The behavior I see is that core patches ARE applied, but new files that the patches introduce are ALSO placed in a core/core and core/b folder. This problem has its own dedicated issue now in #178. |
@bkosborne yep, this patch only adds new files: https://www.drupal.org/project/drupal/issues/2920310#comment-12418762 |
Thanks, confirmed it's a problem. Yeah, we need to be able to specify the patch level to use for applying patches, but I think it needs to be done per-patch and not per-project. Drupal core patches will always have the /b/core/ path in the patch, so they need p2, but contrib modules don't have the extra level, so they need to be applied with p1. |
The same issue occurs for the patches in https://www.drupal.org/project/drupal/issues/2835825 |
Another instance of needing to specify patch depth on a per-patch basis. That's a 2.0.0 thing, and is tracked on #93. |
…er Patches struggles with patches that introduce new file. The solution is to upgrade to the 1.x-dev branch of Composer Patches and add some extra config to Composer.json See: - cweagans/composer-patches#199 - cweagans/composer-patches#43 - cweagans/composer-patches#101 - rwohleb/composer-patches#1
For current 1.x, patchLevel should help with patches for drupal/core. |
- Backport to `1.x` - Reroll of cweagans#101 - Fixes cweagans#43
- Backport to `1.x` - Reroll of cweagans#101 - Fixes cweagans#43
|
https://www.drupal.org/files/issues/drupal-migrate_skip_on_value-2711949-2.patch
I'm using drupal-composer/drupal-project and when I try to apply the patch listed above, it creates it as web/core/core/core/modules/migrate/src/Plugin/migrate/process/SkipOnValue.php, etc.
The text was updated successfully, but these errors were encountered: