Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When a module or package relies on a component or module with Composer (see #2337283: Add a composer.json file to every component), the dependency is not resolved by drupal/core
even though it ought to be.
Proposed resolution
Implement a replace section to the current core/composer.json
. This will be similar to Symfony's and Laravel's.
Remaining tasks
Write Patch- Update if #2337283: Add a composer.json file to every component or #2401519: [policy] Decide on Composer Package Names make any changes to the package names
User interface changes
None
API changes
None
Comment | File | Size | Author |
---|---|---|---|
#4 | composer_replace-2456009-4.patch | 3.61 KB | davidwbarratt |
Comments
Comment #1
davidwbarratt CreditAttribution: davidwbarratt commentedComment #2
davidwbarratt CreditAttribution: davidwbarratt commentedComment #3
Crell CreditAttribution: Crell commentedI think we're leaning toward using drupal-core as the vendor for core components, no?
I am +1 on this patch, but we should probably wait until more of the components have composer.json files and we have a pattern nicely established.
Comment #4
davidwbarratt CreditAttribution: davidwbarratt as a volunteer and commentedSince we have a standard now in #2401519: [policy] Decide on Composer Package Names, I updated the existing components and added anything you could possibly depend on. Now if your module depends on
drupal/views
it will be resolved bydrupal/core
.Comment #5
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedThe composer package naming policy was recently approved. I reviewed the patch in details every component, module, theme and install profile is listed, nothing is missing. This patch makes see core subtree split 1000% more usable, because we can resolve core modules and components directly without any hacks.
Comment #7
hussainwebIt appears to be a random fail. Retesting.
Comment #9
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedBack to RTBC
Comment #10
alexpottIt's going to be a pain to keep this up-to-date but this makes sense and other projects are doing it so +1. This patch is not subject to beta evaluation as it is not changing PHP code just composer configuration and we're still in the process of getting this right.
Committed aff100b and pushed to 8.0.x. Thanks!