-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Short description of the issue
This might be related to this issue: #1118
I've encountered problems on a site where I wanted to have a single-language title
field on a multi-language template. The reason for this is that the page itself has multilang content but the title is really always only a single language. To make it less abstract: It's my personal website where I want to showcase my modules. So the description is in DE/EN but the title of the page is always single language, like RockPageBuilder
or RockMigrations
etc...
I've used Robin's solution mentioned in this thread: https://processwire.com/talk/topic/24431-how-to-disable-multi-language-page-title-for-one-template/?do=findComment&comment=206825
Today I realised that my page names are not auto-updating on page save, which should be done via a RockMigrations helper that I'm using all over for a long time.
I found out that the issue comes from the title field. The problem is that it has still a multi-lang value in the API but it only has a single-lang UI in the backend:
While I totally understand that from a technical point of view it makes the field useless for the real world.
Actual behavior
The problem is that if a user with lang EN inputs foo
the field will show foo
for him. But if another user with lang DE edits that page he/she will see value bar
that has been input sometime in the past. Now if that DE user changes the field to baz
we will have inconsistent values:
EN = foo
DE = baz
Steps to reproduce the issue
- On a multilang site and template add the hook to set the title field to
useLanguages = false
- Make sure your user is using the default language
- Enter
DEFAULT
into the title field and save - Change the user's language to non-default
- Enter
NON-DEFAULT
into the title field and save - Now switch languages in your user's profile and reload the page edit screen - you will see the value of the title field will change from
DEFAULT
toNON-DEFAULT
and vice versa
Possible Solution
I'm not really sure what to do about that and wether that is an issue or not. Technically it might not be an issue, but it would be nice to have a simple solution to just make some fields on a multi-language page single language only. And there - of course - they should always have the same value no matter what language the editor has set in his/her profile.
Setup/Environment
ProcessWire: 3.0.222
PHP: 8.1.16