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
As per trait StringTranslationTrait the string translation service should be injected if possible.
StringTranslationTrait
uses \Drupal
to find the service if it's not available, but we should specify it explicitly.
Proposed resolution
Explicitly inject the string translation service into BookBreadcrumbBuilder::__construct()
as part of the inversion of control pattern.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#7 | inject_string_translation_service-2562645-6.patch | 1.73 KB | morenstrat |
Comments
Comment #2
morenstratComment #3
morenstratComment #5
Mile23Bumping to 8.2.x since it's a code change.
If there's not already a string translation service in the class property,
StringTranslationTrait
will use\Drupal
to discover it, but we should supply it explicitly. So yay this issue does the right thing. Except for this:StringTranslationTrait
has thesetStringTranslation()
method which we should use.Comment #6
Mile23Comment #7
morenstratUpdated patch using
$this->setStringTranslation()
.Comment #8
Mile23Makes the changes from #5, patch applies, tests are green, let's do it. :-)
Comment #10
Mile23I can't repro the fail locally. It's our old pal Drupal\migrate_drupal_ui\Tests\d6\MigrateUpgrade6Test.
Setting to RTBC.
Comment #11
Wim LeersComment #13
Wim LeersComment #16
daffie CreditAttribution: daffie commentedComment #18
daffie CreditAttribution: daffie commentedComment #19
xjmPostponing as per #2729625-20: Inject services into BookAdminEditForm. Let's explore a little to see if we can find out a way to scope these that is not one controller at a time. Thanks!
Comment #34
quietone CreditAttribution: quietone at PreviousNext commentedThis extension is being deprecated, see #3376070: [Meta] Tasks to deprecate Book module. It will be removed from core and moved to a contrib project, #3376101: [11.x] [Meta] Tasks to remove Book.
This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
This issue may be re-opened if it can be considered critical, If unsure, re-open the issue and ask in a comment.
Comment #35
quietone CreditAttribution: quietone at PreviousNext commentedI think this was fixed by #2470896: Make Book navigation translatable. Therefor closing as outdated