-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
Multilang permalinks for Writer field #6668
Conversation
15ad808
to
0f9f6ab
Compare
Do you think we need language prefix for file permalinks? Is there any difference both |
@afbora Valid point. I'll check what's the best way to do just pages. |
3865e8b
to
cf04c08
Compare
cf04c08
to
e64c305
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.
LGTM 👍
Any chance, we can get the code coverage back up or do you think it's another coverage mistake? |
@bastianallgeier as I wrote above, I think the |
Forget my comment. I missed your remark about the code coverage. |
Description
It looks to me like PhpUnit again ignores a test due to the method name,
::url
does have unit tests.Summary of changes
::permalink()
now returns a localized permalink in a multilang setupReasoning
This should resolve #5551.
When
language.detect
setting is disabled, Kirby has no way to automatically figure out to which language to route a normal permalink. This is why the permalinks need to include the language code themselves, representing a permanent link to that page in this specific language. #6312 added the routing support for this. But this PR adds that those language-based permalinks are exposed in the right places:$page->permalink()
Additional context
I hope I have covered all cases to now convert not just normal permalinks but language-based permalinks back and forth with UUIDs and normal IDs in the Panel code.
@afbora It would be super valuable to get your expert testing skills thrown at this to be sure.
Changelog
Fixes
$page->permalink()
returns a language-based permalink for the current content languageReady?
For review team