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.

Plugins

Can't save new page via Admin Plugin

Solved by Karmalakas View solution

Started by Nick Rhodes 5 years ago · 8 replies · 615 views
5 years ago

Getting a

Save Failed: Invalid argument supplied for foreach()

error when trying to save a page via Admin. Can save other pages without problems.

Thought it might have something to do with permissions, but folder is 777.

What could be the issue?

5 years ago

From the info you've provided, my best guess would be - there's something wrong with submitted form. Did you add some plugin maybe when it started to fail? What template and blueprint is used for the page you try to save? Is this the full error message?

For future reference, try to add as much information as possible - you might get some answers much quicker.

5 years ago

Thanks for your answer.
Yes, the full message is save_failed|690x105
Other pages of the same website, using the same template and blueprint can be saved normally. It's only this one that can't be saved via the Admin Plugin.

5 years ago

So the screenshot alone provides more info than your initial post (where you didn't mention, that pages of the same template work fine) - it's a draft. So that narrows guesses down to:

  • Some value in the submitted form is messing up something
    • Could you try emptying your inputs one by one and see if it goes through?
  • Something in the code is not right while working with drafts
    • Could you try creating a completely new page, save it, and then filling all form at once and see if it goes through?
5 years ago

The "You are editing a saved draft" message only appears in conjunction with the "Save Failed" error (after I try to save the page after a modification via Admin).
The page itself is currently published, and can be saved via SSH with no issues.

I tried creating a new page via Admin, same error seems to be happening:save_failed2|690x426

5 years ago Solution

Could you try disabling Aura and then create a new page?

Now I'm just pointing fingers blindly, because I tried Aura some time ago and didn't have an issue, but still...

Also if you could enable debugger and check if there's more to the error. I suspect it should say the file and line where foreach()fails

BTW, there were some issues when mandatory fields where left empty. Could you try filling at least the title field and try saving?

5 years ago

Could you try disabling Aura and then create a new page?

Bingo. Thanks!

Seems that with an empty Page Description field at Aura, for some reason a page cannot be saved via Admin, even though it's not a mandatory field.

5 years ago

That's actually a bit weird. Just yesterday I saved a few pages on my site without any description in Aura. Although I didn't try creating a new page. Will check some time later

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 43 1 week ago
Plugins · by Xavier, 4 weeks ago
2 53 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1179 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 47 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 72 2 months ago