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
The Date module cannot be installed with composer due to "not fully declared" dependency on date_api.
The date module declares its dependency on date_api submodule. But external tools like Composer don't know that it is a submodule.
Proposed resolution
The is a change record for Drupal core that introduced a project namespaces for module dependencies.
According to that the date.info should be changed to replace dependencies with the following:
dependencies[] = date:date_api
Original report
https://www.drupal.org/node/2718229#comment-11562359 by @borsna
Comment | File | Size | Author |
---|---|---|---|
#25 | include_project-2792385-24.patch | 4.63 KB | brunodbo |
| |||
#21 | include_project-2792385-21.patch | 6.12 KB | brunodbo |
| |||
#17 | include_project-2792385-17.patch | 4.32 KB | brunodbo |
| |||
#15 | include_project-2792385-15.patch | 3.05 KB | brunodbo |
| |||
#12 | include_project-2792385-12.patch | 3.17 KB | aadil.addweb |
|
Comments
Comment #2
aadil.addweb CreditAttribution: aadil.addweb at AddWeb Solution Pvt. Ltd. commentedPFA patch to resolve your issue.
Comment #3
aadil.addweb CreditAttribution: aadil.addweb at AddWeb Solution Pvt. Ltd. commentedComment #4
pingwin4egThanks @binoli.lalani
Maybe we should include all submodules in this issue alltogether? (Because the fix is pretty simple)
Comment #5
aadil.addweb CreditAttribution: aadil.addweb at AddWeb Solution Pvt. Ltd. commentedPFA patch
Comment #6
aadil.addweb CreditAttribution: aadil.addweb at AddWeb Solution Pvt. Ltd. commented@pingwin4eg: Awaiting for your inputs/feedbacks.
Comment #7
pingwin4eg@binoli.lalani Sorry, I totally missed this.
I tested the latest patch. It's OK. date_api namespaced everywhere. But there are still other submodules left in dependencies.
To be exact I checked all of them. And these 2 also need to have namespace of
date:
:date_repeat
date_repeat_field
in these 2 info files:
Comment #8
aadil.addweb CreditAttribution: aadil.addweb at AddWeb Solution Pvt. Ltd. commentedPFA patch w.r.t #7 comments.
Comment #9
riddhi.addweb CreditAttribution: riddhi.addweb at AddWeb Solution Pvt. Ltd. commentedComment #10
pingwin4eg@binoli.addweb 2 last patches need to be combined.
Comment #11
aadil.addweb CreditAttribution: aadil.addweb at AddWeb Solution Pvt. Ltd. commentedComment #12
aadil.addweb CreditAttribution: aadil.addweb at AddWeb Solution Pvt. Ltd. commentedPFA revised patch.
Comment #13
pingwin4egOK now. Good job!
Comment #14
DamienMcKennaDoing this will break distros, #2855026: Installation profiles do not support project:module format for dependencies needs to be fixed first.
Comment #15
brunodboReroll of patch in #12. #2855026: Installation profiles do not support project:module format for dependencies is fixed, so this should be good to go in now?
Comment #16
DamienMcKennaA far as Drupal 7 is concerned, the core issue turned out to be a bug in Panopoly.
This needs a little work as the other modules should also be listed in project:module format.
Comment #17
brunodboNew patch with all dependencies listed in project:module format.
Comment #18
joelpittetFrom the docs:
https://www.drupal.org/docs/7/creating-custom-modules/writing-module-inf...
We need to add this if we are changing to the new format:
dependencies[] = drupal:system (>= 7.40)
Comment #19
DamienMcKennaGiven that we're at core 7.61, I'm not going to worry about supporting a version of core that old.
Comment #20
joelpittetI guess the people not willing to update core will likely not update contrib, and if they are patching an old version they'd likely patch contrib...
And that core version is > 3 years old...
I'm not sure what happens with test dependencies, does anybody know?
But this test module should get the same treatment:
./tests/date_test/date_test.info:dependencies[] = date
I just ran this to review:
grep -ir dependencies .
in the date project.Comment #21
brunodboNew patch with updated test dependencies.
Comment #22
brunodboWait, I read the note on test dependencies wrong on https://www.drupal.org/docs/7/creating-custom-modules/writing-module-inf.... Hm, not sure what should happen with dependencies in tests (as opposed to test dependencies listed in a module .info file).
Comment #23
joelpittetI'm learning some new things here too... the reason for that change is composer, in the test it doesn't download anything... I'm kinda surprised it worked, lol.
Comment #24
joelpittet@brunodbo Maybe we remove that change in the test file because it's not needed, but otherwise this is got all the bits and RTBC.
Comment #25
brunodboYep, agreed not to change the test files if not needed. Reverted that change in this patch.
Comment #27
DamienMcKennaCommitted. Thanks.