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
A <a href="/"></a>
link is not displayed correctly. It is replaced with but only works with fromRoute(), not fromUri(), so that needs a special case somewhere.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#5 | front_is_not-2538928-5-interdiff.txt | 954 bytes | mbovan |
#5 | front_is_not-2538928-5.patch | 1.22 KB | mbovan |
#3 | front_is_not-2538928-3-TEST-ONLY.patch | 555 bytes | mbovan |
#1 | front_is_not-2538928-1.patch | 1.2 KB | mbovan |
Comments
Comment #1
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedProviding a fix.
Comment #2
BerdirI don't really get what this is doing :)
Can we have a test-fail patch?
Comment #3
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedHere is the test-only patch.
Re #2:
$paths['/']
contains something like: "http//d8.dev/"... To assert results correctly I replaced<front>
(encoded as%3Cfront%3E
) with empty string.Comment #5
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedAs discussed, changed test method that returns
$path
, instead of changing$path
output inassertEqual()
.Comment #6
BerdirI guess that check could be outside of the if but yes, I like this a lot more. Before, we were testing for the broken behavior because both places did it incorrectly.
Comment #8
Garrett Albright CreditAttribution: Garrett Albright commentedWeird. Tests don't fail before this patch… it looks like the output of the test case was wrong in the same way that Pathologic was wrong. Not really sure what to make of that.
Anyway, committed and pushed.
Comment #9
Garrett Albright CreditAttribution: Garrett Albright commentedMarking for NR on the D7 branch so we can see if it's having the same problem. I don't think it does, though.
Comment #10
BerdirYes, 7.x-1.x is certainly fine, this is completely different in 8.x, moving back to 8.x :) And yes, that's the problem with dynamic assertions, when the test is implementing the same logic as the actual code then you aren't testing much :)
Not easy to change that for URL's, only thing I can see is having hardcoded Url::fromRoute('') and so on objects that you are comparing against, that might be a bit clearer than a helper function that does magic.