When creating a new entity internal URLs don't work correctly for some formats:

  1. Pass: /mypath
  2. Pass: mypath?key=value
  3. Fail: /mypath?key=value

Updating an entity with #3 above works fine as entity updates don't require the validation to pass, if validation fails the code falls back to an external URL. #1 above passes as it's valid for the internal_pattern_file regex, #2 passes as it's valid for internal_pattern. But the last fails with the error:

The value /mypath?key=value provided for My Path Link is not a valid URL.

This is because the first part of the internal_path doesn't allow the / character.

Comments

hadsie created an issue. See original summary.

hadsie’s picture

Status: Active » Needs review
StatusFileSize
new748 bytes
hadsie’s picture

Title: Internal link regex » Internal link regex needs support for / character
damienmckenna’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Thanks for uncovering that bug and providing a patch.

I think we just need some test coverage.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new2.03 KB

Test coverage.

damienmckenna’s picture

Issue tags: -Needs tests
StatusFileSize
new1.3 KB

Tests-only.

damienmckenna’s picture

Status: Needs review » Needs work

The last submitted patch, 6: link-n3330054-5-tests-only.patch, failed testing. View results

damienmckenna’s picture

Status: Needs work » Needs review

The tests-only patch fails, which is expected. I think this is good to go.

damienmckenna’s picture

Status: Needs review » Fixed

Committed. Thank you!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.