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.
Use case:Add a theme suggestion based on the language of a message.
For now, there is no way to get the language of the Message (outside of the class)
Comment | File | Size | Author |
---|---|---|---|
#3 | message-Add_getLanguage_in_MessageInterface-3157375-2-8.x.patch | 994 bytes | DuneBL |
|
Issue fork message-3157375
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
DuneBLComment #3
DuneBLHere is the patch
Comment #4
tcrawford CreditAttribution: tcrawford commentedI tested this patch and it works. The feature will help resolve a language translation issue on the message_notify module #2965975 and therefore it would be good to move this forward.
Comment #5
pfrenssenComment #7
pfrenssenTests are failing on Drupal 10 because they are using the stable theme which has been removed. This is being handled in #3314596: Tests fail on D10 due to missing theme.
Comment #8
jhedstromShould we make a new major version since an interface change is technically breaking? I'm not sure if anybody has, or would, implement this interface outside of the module though...
Comment #9
pfrenssenWe can not rule out that there might be a project that has their own implementation of the Message entity, but this should indeed be rare, and chances are high that IF this is the case, then they would be extending the current class rather than building their own entire class from scratch.
I saw that core even allows adding methods to interfaces in minor releases. In core only interfaces tagged with
@api
will not be touched in minor releases (ref. https://www.drupal.org/about/core/policies/core-change-policies/bc-polic...). This@api
tag is not commonly used in contrib though.I personally think we're fine adding this in a minor release and don't expect this to impact our users, but we cannot rule out that there is _someone_ out there who might be affected.
Comment #11
jhedstromThat makes sense to me! Thanks all!