Language issues on system pages & pagelist macro #310
Labels
No labels
Component: User interface
Component: Wymeditor
Help wanted
Level: Difficult
Level: Easy
Level: Moderate
Pagetype: Festival
Pagetype: Mailinglist
Pagetype: Peer reviewed article
Pagetype: Text
Privacy GDPR AVG
status: has conflicts
Status: Needs changes
Status: Needs discussion
Status: Needs review
Status: Ready to merge
Status: Waiting for response
Type: Bug
Type: Enhancement
Type: Question
Usecase: De Stadsbron
Usecase: Koppelting
Usecase: MeetjeStad
Value: Coders
Value: Security
Value: Users
Value: Visitors
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
harmen/hypha#310
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Recently, we did some language-related cleanups (e.g. properly splitting content and interface languages) and I think that language selection works rather well for normal pages now.
However, for system pages, there is no unified way to specify a content language. This is intentional, since:
Instead, system pages are free to add a language selection as arguments after their name, if they need it (e.g.
/tag/en/foo).However, I noticed some issues:
The page index now generates urls likeFixed by #311./en/indexand [expects$O_O->getContentLanguage()to be set correctly] when rendering the index. Effectively, this means that all language-links in the index result in a 404.$O_O->getContentLanguage(). Since that is unset for system pages, that will just fall back to the default content language instead. Then, if the page does not exist in that language, an error is thrown.Issue 1. is probably easy to fix by just accepting the language as a second argument.
Issue 2. is a bit more involved. I think that this would involve the content language to be set for system pages as well. Since each system page might have its own url structure, we cannot do this generically, so it must be done inside the datatype class. Adding the following code to
tagindexpage::tagindexview()works, but that's not so nice (it abuses the fallback language, I think):Should there be a
setContentLanguage()maybe?A second way to look at this issue is that when instantiating an datatype class, you can only pass the page list node, but not the language to be used (that is implied to be
$O_O->getContentLanguage()). This is currently acceptable (with the above fix), since the tag index page will only return pages tagged with a tag in the selected language, which implies that these pages are available in the same language as well.However, when generalizing this page list (e.g. as part of #87), you might end up rendering other pages that are not available in the same language. You might want to then specify the language to use explicitly, or maybe make sure that there is a fallback in place (if a page is not available in the requested content language, fallback to the site default or an arbitrary language?).
There might be other related issues in other system pages maybe?