getgrav / getgrav/grav-plugin-admin

grav.CRITICAL: Syntax error with Page Security tab - Page Groups

Open
#2,409 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
377
Forks
225
Avg merge
11h 51m
Merged PRs (30d)
4

Description

I detected the following bug:
There is **in Security tab of page configuration.**
If you configure the "**Page Groups**" with no value or with a group but don't select any specific CRUD permisión **when saving** it brokes giving the next message:

_Server Error
Sorry, something went terribly wrong!
4 - Syntax error
For further details please review your logs/ folder, or enable displaying of errors in your system configuration._

Then in grav.log yo will see:
grav.CRITICAL: Syntax error - Trace: #0 /var/www/vhosts/[...]/user/plugins/flex-objects/classes/Admin/AdminController.php(1861): json_decode('', true, 512, 4194304) #1

And 30 lines more.
8 about AdminController
4 about EventDispatcher
4 about Themes
10 about RequestHandler
etc.

_This was found trying to figure out how can I configure a private page for users (With Grav Login Plugin)_

Best regards

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure from the Page Security tab by saving Page Groups with no value or without selecting CRUD permissions. Start at AdminController.php line 1861 and compare the request with the grav.log json_decode error. Done means the configuration saves without the server error or syntax error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authorization, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.