Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Error saving pages

Solved by steve View solution

Started by steve 3 years ago · 3 replies · 408 views
3 years ago

Hi, I am running.
Ubuntu 20.04
Nginx & PHP 8.1.17
Grav 1.7.40
I am getting a error trying to save pages from the admin panel.

Failed to save entry: foreach() argument must be of type array|object, null given

So I can not find any reference to this error in any of the servers logs, and idea where the failure is?

3 years ago

Hello, do you save immediately after page creation? Or do you create a page first, add content and try to save?

3 years ago

Hi, The error showed when trying to save a page. I installed grav-skeleton-blog-site+admin-2.0.0.zip. Last night I installed grav-admin-v1.7.35.zip then installed grav-skeleton-blog-site+admin-2.0.0.zip over it and made a few modifications and my site is working fine now. So it might be a bug in grav-skeleton-blog-site+admin-2.0.0.zip. I hope this helps to explain the issue.

3 years ago Solution

Well it happened again, With further investigation it turned out my nginx conf was silently blocking www-data making Grav update from the admin panel, So a fresh install of the grav-skeleton-blog-site+admin-2.0.0.zip and doing a Grav update from cli worked. below is the code that caught me out.

TXT
## Begin - Security
        # deny all direct access for these folders
        location ~* /(\.git|cache|bin|logs|backup|tests)/.*$ { return 403; }
        # deny running scripts inside core system folders
        location ~* /(system|vendor)/.*\.(txt|xml|md|html|json|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
        # deny running scripts inside user folder
        location ~* /user/.*\.(txt|md|json|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
        # deny access to specific files in the root folder
        location ~ /(LICENSE\.txt|composer\.

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 50 6 hours ago
Support · by Anna, 2 days ago
2 58 9 hours ago
Support · by Justin Young, 10 hours ago
1 28 10 hours ago
Support · by Duc , 1 week ago
2 63 5 days ago
Support · by Colin Hume, 1 week ago
2 53 5 days ago