processwire-issues
processwire-issues copied to clipboard
Non-superusers can't change hidden status of languages
Short description of the issue
I know this isn't a common use case, but users with lang-edit can't change the hidden status of languages. They can see and change the unpublished status, but in my use case I want to set languages to hidden for a period of time before they become live - note that I am using them for controlling languages available for a frontend language selection field.
Expected behavior
Hidden checkbox is available on the Settings tab.
Actual behavior
It's not shown
Isn't the problem with hiding languages that it will also make them disappear from the edit screen? So you can't start filling in the content before they become live either way.
@daun - perhaps, but I don't have any multi-language fields anyway. I use the languages for triggering a runtime translation of an SMS message sent to the user. I am using the hidden status to remove it from a frontend form where the user edits their profile. I could do this other ways, eg add a new "hide" checkbox field to the language template, but I don't really understand if it's an intentional decision by @ryancramerdesign to make this unavailable for non-superusers, or a bug - seems like a bug to me.
I agree it seems like a bug as far as expected vs. actual behavior go.
@adrianbj does it help if the user has page-hide permission?
@matjazpotocnik - I'm not sure, but the user has the page-edit permission and they can edit languages. Given that I don't have the page-hide permission installed, it should be delegated to page-edit (https://github.com/processwire/processwire/blob/6ff498f503db118d5b6c190b35bd937b38b80a77/wire/core/Permissions.php#L43) so I feel like that should work.
I have a role editor1 with lang-edit and page-edit perms (I also don't have page-hide perm), and this user has the option to hide a language in the Settings tab:
I'm obviously missing something...
Weird, in my case, the user has the lang-edit permission and this is what they see. I wonder if it might be because my users are on an alternate user template / parent page. That setup still seems to break things in various obscure ways.
I tested with the user in an alternate branch, and it's working here... Can you test with the "regular" user first? Just to rule out "alternate" user issue?
OK, on another install where all the users are regular, I actually see this where there are no status options to change.
Ok, I'm out of ideas, I can't debug if I can't reproduce...
For sanity's sake I just tested another install where initially no users had language editing permission. Gave it to them, and tested and I see the same empty Settings section again. These are all very different sites and I can't think of anything that would cause their behavior to be different to what you're seeing. Maybe Ryan has some thoughts?
It must be something with roles/permissions... my test user has this permission in their role: page-view, page-edit, lang-edit, page-delete, page-move, profile-edit, tracy-debugger