kirby
kirby copied to clipboard
Add language specific UUID URLs
This PR …
This is an attempt to finally get parts of the multi-language UUID issues solved. (https://github.com/getkirby/kirby/issues/5551)
This adds a new route for language-specific UUID urls:
Examples:
/en/@/page/1234
/en/@/file/1234
Docs
Ready?
- [ ] In-code documentation (wherever needed)
- [ ] Unit tests for fixed bug/feature
- [ ] Tests and checks all pass
For review team
- [ ] Add lab and/or sandbox examples (wherever helpful)
- [ ] Add changes & docs to release notes draft in Notion
Either we should add unit tests or we should be more explicit what we want to ignore for coverage.
@distantnative I'm trying to create tests for the UUID route but I fail to setup a test environment with working UUIDs. Could you maybe have a look at the test? Why can the model not be found like that?
Had you tried manually adding a uuid in the app setup ['content' => ['uuid' => 'my-uuid']]
? That's how many of the other tests do it.
Yep, I tried that too but also without luck.
@bastianallgeier Ok I finally understood where it fails:
- The uuid route looks up the model lazily, so only from cache. Since the cache is not populated, it fails
- When I was trying to manually set a UUID, I did it with
content
. But we are in multilang territory, so we have to set thetranslations
array instead
Alternatively, solving https://github.com/getkirby/kirby/issues/5181 too.