Over in #2462279: Language prefix for custom menu link paths are saved but not used we want to do some fixes to link saving, and it is being blocked by what I think is a "wrong" test. That is, we are testing for a link to being saved with //alias. Which in my opinion we should not at all allow, because if I were to input that, I would expect it to output a protocol agnostic URL (like //google.com).

Patch coming up.

CommentFileSizeAuthor
#2 avoid_testing_for-2636424-2.patch567 byteseiriksm

Comments

eiriksm created an issue. See original summary.

eiriksm’s picture

Status: Active » Needs review
StatusFileSize
new567 bytes
eiriksm’s picture

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Well ideally we would add support for protocol relative URLs, but some people disagree with that :(

For ow testing the right thing is fine.

Given that this is test only this can land in both 8.0.x and 8.1.x

eiriksm’s picture

I also agree with that. But if we want to add that, then this test would have to change into this anyway, I guess ;)

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

I think we should take the opportunity to improve the test so that it would fail if we changed it back to '/' . $path['alias'],

eiriksm’s picture

Status: Needs work » Needs review

Hm, not sure I follow what you want to add?

This issue is created because it will start to fail if #2462279: Language prefix for custom menu link paths are saved but not used gets committed, because that would disallow paths starting with //. Right now, if you try to add a path like that (say for example //google.com) shortcut will get saved and try to point to the internal path _base_path_/google.com. So that future new bug fix will ensure the test coverage, I think.

To answer your question, I don't know how to improve the test in this issue. So to improve the test... we could check that the string '//' is not there, but that feels like it was not what you asked for.

Another way to improve it was to add "//alias" to the list of path we are not allowed to save, but that would unfortunately still not pass (that would pass if we committed #2462279: Language prefix for custom menu link paths are saved but not used).

I understand what you are asking for, but that would be covered by that future bug fix (which should rtbc after this lands). So, in a hopeful manner, I am changing the status back to "needs review". :)

Sorry if I misunderstood your request. :)

alexpott’s picture

eiriksm’s picture

Well, because I initially did that, but was asked to create a seperate issue for this seemingly unrelated change to make it easier for commiters. :D

If it is fine by you, I am happy to include this fix in that issue

alexpott’s picture

Status: Needs review » Fixed

Fair enough!

Committed 382a8a4 and pushed to 8.0.x and 8.1.x. Thanks!

  • alexpott committed 1168a23 on 8.1.x
    Issue #2636424 by eiriksm: Avoid testing for relative link starting with...

  • alexpott committed 382a8a4 on 8.0.x
    Issue #2636424 by eiriksm: Avoid testing for relative link starting with...

Status: Fixed » Closed (fixed)

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