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

Error saving pages

Solved by steve View solution

Started by steve 3 years ago · 3 replies · 489 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 BenLaKnet, 5 days ago
1 120 2 days ago
Support · by BenLaKnet, 1 week ago
5 194 2 days ago
Support · by kskt, 2 days ago
0 44 2 days ago
Support · by David Meissner, 3 days ago
0 43 3 days ago
Support · by David Meissner, 3 days ago
3 92 3 days ago