You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a package is of type metapackage (cf https://getcomposer.org/doc/04-schema.md) and the unix patch method is used in vendor/cweagans/composer-patches/src/Patches.php, it fails with: 'Could not apply patch! Skipping. The error was: Cannot apply patch...'
This is because $install_path obtained in postInstall() is null, so in getAndApplyPatch() the -d arg to patch command is empty and causes the patch command to fail.
The attempt to write PATCHES.txt also fails as tries to write to root directory.
$install_path could be set to '.', which allows patch to complete - (though doesn't resolve how PATCHES.txt is used later).
I'm not sure why a number of the Drupal packages are set to metapackage in composer.lock, but they are sub-modules of a large overall module. Ideally I guess these should be of type: drupal-module
The text was updated successfully, but these errors were encountered:
It turns out that using the main module as the key gets the patch applied to the sub-module.
Suggest a special error message if $install_path is empty rather than the generic 'Could not apply patch' when the patch command fails.
Not sure if this is something that can be fixed. metapackage implies that there is no path that the package actually exists at, so it would be difficult for a patcher to apply a patch at that path. :)
I've made a note to explicitly avoid trying to patch metapackages in the plugin + add docs to explain why.
If a package is of type metapackage (cf https://getcomposer.org/doc/04-schema.md) and the unix patch method is used in vendor/cweagans/composer-patches/src/Patches.php, it fails with: 'Could not apply patch! Skipping. The error was: Cannot apply patch...'
This is because $install_path obtained in postInstall() is null, so in getAndApplyPatch() the -d arg to patch command is empty and causes the patch command to fail.
The attempt to write PATCHES.txt also fails as tries to write to root directory.
$install_path could be set to '.', which allows patch to complete - (though doesn't resolve how PATCHES.txt is used later).
I'm not sure why a number of the Drupal packages are set to metapackage in composer.lock, but they are sub-modules of a large overall module. Ideally I guess these should be of type: drupal-module
The text was updated successfully, but these errors were encountered: