Closed michalby closed 4 years ago
Not sure what is merging in the configuration. Are you running any extra plugins?
I first noticed this behavior using SEO plugin (that's why I was switching from expert to normal and back), but I managed to replicate this bug using a fresh grav instance, so Admin Panel, Email, Error, Form, Login, Markdown Notices and Problems plugins, nothing extra.
I will try to reproduce but that merge behavior is definitely weird. Does look like a 3rd party plug-in is doing it.
That bug is not present in 1.7.0-beta.10 with Login v3.0.4 but Grav 1.6.16 with Login v3.0.3 and 3.0.4 both have this issue.
Same issue here with Grav v1.6.24, Admin v1.9.14 and Login v3.3.0.
Looks like it happens in "mergeConfig" used in "pageVisibility" called during "onPagesInitialized":
Changing the line https://github.com/getgrav/grav-plugin-login/blob/73c22387900c7b234d8ad09536417418e7672dda/login.php#L213
to
$config = null;
the issue is gone, but it breaks "parent_acl" check for page visibiltiy:
Hence this is a hint, not a fix...
I'm unable to recreate this in 1.6 or 1.7rc with Login v3.4.0. I really think that it's the fault of the SEO plugin you guys are using. Probably it doesn't happen in 1.7 because it doesn't fire the same events that 1.6 does on page save, and the SEO plugin is making it's changes.
Arggg.. was able to reproduce it and fix.
Only happened in Grav 1.6 BTW, Grav 1.7 handles this better.
When visibility_requires access is set in a page frontmatter using an "expert" editing mode in admin plugin, everything works fine. Here's a working example:
However, when an expert mode is switched to normal, then the page is saved (with or without making any changes to its contents), it starts to appear in menu for all guests. Frontmatter is automatically being changed to include overrides:
A temp fix is to switch back to expert mode, delete four spaces in front of
leaving only four, and save again, or remove everything in a login: section leaving only
with four spaces.
The config that is pasted into the page frontmatter is coming from user/config/plugins/login.yaml Similar behaviour was also described in this issue: https://github.com/getgrav/grav-plugin-login/issues/166#issuecomment-484317114