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
This manifested itself in blowing up a kernel I was writing. Dependency I found came from the following service:
services:
access_check.contact_personal:
class: Drupal\contact\Access\ContactPageAccess
tags:
- { name: access_check, applies_to: _access_contact_personal_tab }
arguments: ['@config.factory', '@user.data']
Proposed resolution
Add the dependency.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#2 | 2848728-contact-module-dependency-2.patch | 336 bytes | Sam152 |
Comments
Comment #2
Sam152 CreditAttribution: Sam152 commentedComment #3
benjy CreditAttribution: benjy at PreviousNext commentedLGTM
Comment #4
larowlan+1
Comment #5
xjmDo we normally add dependencies on required modules?
I think a lot more things than that would depend on user...
Comment #6
benjy CreditAttribution: benjy at PreviousNext commentedWhat says they're required? There isn't an assumption in the config system or the container and services that everything depends on user implicitly? It would make sense that without the dependency the issue would crop up in a cut-back KTB test.
Personally I think it's a good idea to make all dependencies explicit.
Comment #7
jibran@xjm I had the same discussion with @Sam152 when he first faced the issue. I know @benjy is right in his observation but this is true as well that we add user module to almost all the KTB.
This is a special case just for user module and we have faced that issue a lot but I don't think just for the sake of tests we should fix this and yes we normally don't add dependencies on required modules. Let's add the module to dependent KTB and move on. Thanks!
Please feel free to open for more discussion.