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 existing vocabulary translation is ignored for page titles at "entity.taxonomy_vocabulary.overview_form" and "entity.taxonomy_vocabulary.reset_form" routes.
Steps to reproduce:
- Drupal 8.6.10/8.7.x fresh install with standard profile
- Enable the locale, config_translation and language modules.
- As admin user, add any language at /admin/config/regional/language, for instance, Spanish
- Add a translation for the just added language to the Tags taxonomy vocabulary at /admin/structure/taxonomy/manage/tags/translate
- Go to the Tags vocabulary overview in the new language at /***LANGUAGE_PREFIX***/admin/structure/taxonomy/manage/tags/overview. The page title will show the vocabulary name in english, ignoring the existing translation for the current language
Proposed resolution
Enable the "with_config_overrides" option for the "taxonomy_vocabulary" parameter.
Remaining tasks
Review patch.
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
None
Comment | File | Size | Author |
---|---|---|---|
#35 | taxonomy-3037157-35-FAIL.patch | 3.75 KB | xjm |
Issue fork drupal-3037157
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
manuel.adanComment #3
manuel.adanComment #4
manuel.adanComment #6
Anas_maw CreditAttribution: Anas_maw as a volunteer commentedI can confirm patch in #2 works for me.
Comment #9
tanubansal CreditAttribution: tanubansal at Salsa Digital commentedAfter adding patch #2, its showing translated page title on /fr/admin/structure/taxonomy/manage/tags/overview
RTBC +1
Comment #10
mayurjadhav CreditAttribution: mayurjadhav at Srijan | A Material+ Company commentedAble tp apply patch on 9.1.x and patch works as expected. +1 for RTBC.
Comment #12
Abhijith S CreditAttribution: Abhijith S as a volunteer and at Zyxware Technologies commentedApplied patch #2 and it works fine.The translated vocabulary name is showing after applying this patch.
Before patch;
After patch:
Comment #13
Abhijith S CreditAttribution: Abhijith S as a volunteer and at Zyxware Technologies commentedComment #14
larowlanAs this is a bug, we need a test demonstrating that this is resolved.
Also, I don't believe this is the correct fix.
The issue here is that
\Drupal\taxonomy\Controller\TaxonomyController::vocabularyTitle
is not loading the correct entity context in the same way that\Drupal\Core\Entity\Controller\EntityController::title
is.I wonder if we should just use
\Drupal\Core\Entity\Controller\EntityController::title
instead and deprecate\Drupal\taxonomy\Controller\TaxonomyController::vocabularyTitle
instead of duplicating all that code.Comment #17
sudiptadas19 CreditAttribution: sudiptadas19 at QED42 for Drupal India Association commentedFix translation issues, added test file. Available in MR395. Please review.
Comment #18
siddhant.bhosale CreditAttribution: siddhant.bhosale as a volunteer and at QED42 commentedComment #19
SpadXIII CreditAttribution: SpadXIII at SIM commentedThis looks like it's fixed with merge request 395.
The added test looks straightforward enough.
Comment #20
catchMR is showing 'custom commands failed'. Removing 'needs tests' tag since tests have been added.
Comment #22
mohit_aghera CreditAttribution: mohit_aghera at QED42 commentedResolving phpcs issues for the further progress of the issue.
Comment #24
Rinku Jacob 13 CreditAttribution: Rinku Jacob 13 at Zyxware Technologies commentedVerified and tested patch #2 for drupal 9.3.x-dev version. Patch applied successfully and looks good to me.Adding screenshot for the reference.
Need +1 RTBC
Comment #25
joachim CreditAttribution: joachim at Factorial GmbH commentedTests are failing; also see my comment on the MR.
Comment #26
mohit_aghera CreditAttribution: mohit_aghera at QED42 commented@joachim
Updated following points:
- Remove vocabularyTitle() method.
- Fix test cases. Test cases are passing on local now.
- Remove deprecated method calls.
Comment #27
joachim CreditAttribution: joachim as a volunteer commentedGreat, thanks!
Comment #28
xjmSaving issue credits.
Removing credit for unneeded screenshots in #24. There were already screenshots on the issue demonstrating the fix, so a second set isn't needed. What was needed at that point was fixing phpcs errors, and reviewing the latest code changes since the previous approach. Thanks! (I've left credit for #12 as #9 did not include a "before" screenshot for comparison.)
Comment #29
xjmComment #30
xjmComment #31
xjmNW for the above small points of feedback on the MR.
It would be good to also post a test-only patch or separate MR to demonstrate the test coverage of the added test.
Thanks everyone for working on this bug!
Comment #33
phenaproximaOK, addressed all of @xjm's points as best I could. Back to review!
Comment #34
tim.plunkettThanks! I think that is sufficient.
Comment #35
xjmAttaching a test-only patch as per #31.
Comment #36
phenaproximaAt @xjm's request, opened #3221140: Don't call mb_strtolower() when generating machine names in Taxonomy tests to deal with the (seemingly unnecessary)
mb_strtolower()
calls strewn across Taxonomy's test suite.Comment #38
phenaproximaFail patch failed. Back to RTBC.
Comment #39
xjmAhoy, this is what happens when we use GitLab's UI and don't have the 80-character line anymore. These comments need to be rewrapped.
Comment #40
xjmComment #41
phenaproximaDone. Since it's literally just whitespace changes, restoring RTBC.
Comment #43
xjmThere was another 80-char thing which I thought we had a rule for, which is the array multiline format. Multivalue arrays are supposed to be put on multiple lines if the line is over 80:
That was straightforward enough to fix on commit. Committed to 9.3.x only since it introduces a deprecation for an internal API. Thanks!
Comment #50
smustgrave CreditAttribution: smustgrave at Mobomo commentedClosed https://www.drupal.org/project/drupal/issues/2924408 as a duplicate of this. Moved over credit.