Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
The space from user input prevents URL to be recognized as internal, hence
UnexpectedValueException: External URLs do not have an internal route name in Drupal\Core\Url->getRouteName()
as routeName parameter is NULL.
Comments
Comment #2
artreaktor CreditAttribution: artreaktor at Drupal Ukraine Community, Adyax commentedComment #3
dawehnerThank you for the fix! For getting this committed we need some additional tests though.
For the additional tests, I think extending
\Drupal\Tests\link\Functional\LinkFieldTest
would be the right place.Comment #4
borisson_Setting to needs work based on #3
Comment #5
mayurjadhav CreditAttribution: mayurjadhav at Blisstering Solutions commentedComment #7
dhirendra.mishra CreditAttribution: dhirendra.mishra commentedComment #8
dhirendra.mishra CreditAttribution: dhirendra.mishra commentedComment #9
chiranjeeb2410 CreditAttribution: chiranjeeb2410 at Google Summer of Code commentedExtended
\Drupal\Tests\link\Functional\LinkFieldTest
as mentioned in #2. Hope for a green.Please review.
Comment #10
cilefen CreditAttribution: cilefen as a volunteer commentedIt looks as though you imported a test class but we need a test.
Comment #11
chiranjeeb2410 CreditAttribution: chiranjeeb2410 at Google Summer of Code commented@cilefen,
Any pointers on implementing that. Could use some advice.
Comment #12
cilefen CreditAttribution: cilefen as a volunteer commented#3 has some advice. You can modify that test class to cover that line.
Comment #13
ankitjain28may CreditAttribution: ankitjain28may as a volunteer and at Google Summer of Code commented@cilefen Can you please let me know what tests are required to write in this
\Drupal\Tests\link\Functional\LinkFieldTest
to validate, Should i create another function to validate or include this in thistestURLValidation
by adding more key/value pairs to this arrayvalid_internal_entries
?Comment #14
ankitjain28may CreditAttribution: ankitjain28may as a volunteer and at Google Summer of Code commentedWe need to include new tests in that file to validate the proposed solution to the problem, not to include the file.
We need not an extra statement, we can add trim function directly as--
$uri = trim($string);
Comment #15
longwaveComment #17
ankitjain28may CreditAttribution: ankitjain28may as a volunteer and at Google Summer of Code commentedThe patch in #15 looks good to me.
Comment #18
artreaktor CreditAttribution: artreaktor at Drupal Ukraine Community, Adyax commentedComment #19
alexpottCommitted and pushed b98cdcad61 to 8.6.x and 4c944ba64e to 8.5.x. Thanks!
Backported to 8.5.x because this is a bugfix with no BC implications.
Comment #22
Wim LeersNice usability improvement 👌 Thanks!