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
Following #2467827: [META] W3C validation for Drupal Core, the W3C validator triggers an error for links generated for route . Unfortunately, the LinkGenerator.hp method adds the hreflang attributes in all cases while are made with tags which does not support the hreflang attribute.
The solution is to unset the hreflang in the same way it is done with href in the case of route.
Comment | File | Size | Author |
---|---|---|---|
#8 | interdiff-3186821-5-6_0.txt | 2.24 KB | mohit_aghera |
#8 | 3186821-test-only.patch | 2.4 KB | mohit_aghera |
#8 | 3186821-6_0.patch | 3.21 KB | mohit_aghera |
#6 | interdiff-3186821-5-6.txt | 2.24 KB | mohit_aghera |
#6 | 3186821-6.patch | 3.21 KB | mohit_aghera |
Issue fork drupal-3186821
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
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commentedPushing a simple patch. No tests updates here to have a first pick at how many tests get eventually broken and needs fixing.
Comment #3
Dom. CreditAttribution: Dom. as a volunteer and at ACINO commentedComment #4
Kristen PolThanks for the issue and the patch.
1) Patch still applies cleanly to 9.2.
2) Although the code added is logical, stylistically, I would do the following instead:
3) Even if the logic stays as is, we need test coverage in
LinkGeneratorTest
.Comment #5
ankithashettyUpdated patch in #3 addresing #4.2 . Retaining status "Needs work" for tests(#4.3). Thanks!
Comment #6
mohit_aghera CreditAttribution: mohit_aghera as a volunteer and at QED42 commentedAdding test cases for basic validation.
Comment #7
larowlanLooking good, can we get a test-only patch here (that should fail)
Comment #8
mohit_aghera CreditAttribution: mohit_aghera as a volunteer and at QED42 commentedAdding test-only patch.
Reuploaded the previous patches again.
Here is the local run for test-only patch:
Comment #10
mohit_aghera CreditAttribution: mohit_aghera as a volunteer and at QED42 commentedChanging to needs review as failures is from the test-only patch.
Comment #11
acbramley CreditAttribution: acbramley at PreviousNext commentedLooking great, fails as expected 🎉
Comment #14
catchCommitted 1b0a441 and pushed to 9.2.x. Thanks! Also cherry-picked to 9.1.x.