Multilang permalinks for Writer field #6668
Open
+63
−24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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