-
-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve link kirbytag behavior when uuid point to non-existing page #6085
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH I'm not sure about this. It could be pretty unexpected to get a link to the homepage instead of the intended deeplink.
An alternative could be to return an empty string instead (meaning the KirbyTag would produce an empty output, i.e. no link at all).
However both solutions have in common that they are very hard to debug. The exception on the other hand breaks the whole page. Difficult...
What about link to error page instead homepage? |
I like that. Then it's just a "broken link" as it would be with a hardcoded URL or path. |
I think other CMS in similar cases would output the text without any link in this case. |
Good comments. I would merge ideas :)
|
when text attr setWill removed link. I got this case, OK. Input
Output
when no text attr setWhat would expected when no link text set? Input
OutputRemove whole kirbytag like that?
|
Given the amount of discussion about this, I think this should not go into a patch release. On the discussion points
|
@distantnative So what would happen when no text is set, uuid is not exists and debug active? |
@afbora depends what our answer is to my first bullet point. Either exception or permalink as pure text. |
Another thing to consider: The expected behavior might depend on the importancy of the link. If it's a link to a legal document or important document, it should always fail to prevent failing legal or other processes afterwards. So maybe it might be important to have a way that the editor/admin can define the expected behavior by the importancy of the link. |
Considering everything, I think the following would be the best compromise to fulfill the most requirements:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change the wording for the exception (see suggestion). But I'm happy with the rest. @lukasbestle @distantnative do you want to have a last look at it? I would also move it to 4.1 though.
03be498
to
304e9a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! 👍
I agree with Bastian on the suggested change, apart from that it's great.
1513ae2
to
5766af2
Compare
Co-Authored-By: Bastian Allgeier <[email protected]>
5766af2
to
5acd88a
Compare
This PR …
Fixes
Breaking changes
None
Ready?
For review team