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.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | 2927723-15.patch | 1.78 KB | longwave |
| #15 | 2927723-15-test-only.patch | 1.09 KB | longwave |
| #9 | 2927723-9.patch | 916 bytes | chiranjeeb2410 |
| #2 | 2927723-2.patch | 615 bytes | artreaktor |
| 9091f43e35.jpg | 69.57 KB | artreaktor |
Comments
Comment #2
artreaktor 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\LinkFieldTestwould be the right place.Comment #4
borisson_Setting to needs work based on #3
Comment #5
mayurjadhav commentedComment #7
dhirendra.mishra commentedComment #8
dhirendra.mishra commentedComment #9
chiranjeeb2410 commentedExtended
\Drupal\Tests\link\Functional\LinkFieldTestas mentioned in #2. Hope for a green.Please review.
Comment #10
cilefen commentedIt looks as though you imported a test class but we need a test.
Comment #11
chiranjeeb2410 commented@cilefen,
Any pointers on implementing that. Could use some advice.
Comment #12
cilefen commented#3 has some advice. You can modify that test class to cover that line.
Comment #13
ankitjain28may commented@cilefen Can you please let me know what tests are required to write in this
\Drupal\Tests\link\Functional\LinkFieldTestto validate, Should i create another function to validate or include this in thistestURLValidationby adding more key/value pairs to this arrayvalid_internal_entries?Comment #14
ankitjain28may 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 commentedThe patch in #15 looks good to me.
Comment #18
artreaktor 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!