getgrav / grav-plugin-admin

Grav Admin Plugin
http://getgrav.org
MIT License
355 stars 227 forks source link

Page Expired error when saving #2301

Open TheoAcker12 opened 2 years ago

TheoAcker12 commented 2 years ago

I'm not sure all of the conditions this might occur. In my case, I have a page with a blueprint that has a list with a lot of fields in it. Once enough items are in the list, the page will no longer save when editing it in normal mode. I can still save the page in expert mode. I had initially had the problem when I had a fieldset inside a list, but I tried it with no fieldset and still experienced the issue.

To recreate, use this blueprint (or something equivalent):

title: List Test
extends@: default

form:
  fields:
    tabs:
      type: tabs
      fields:
        list_test:
            type: tab
            title: List Test
            fields:
                header.items:
                    type: list
                    label: List
                    description: A straightforward list to test a potential bug
                    collapsed: true
                    fields:
                        .value1:
                            type: text
                            label: "Value 1"
                            default: 'text'
                        .value2:
                            type: toggle
                            label: "Value 2"
                            highlight: 1
                            default: 0
                            options:
                                0: Off
                                1: On
                            validate:
                                type: bool
                        .value3:
                            type: text
                            label: "Value 3"
                        .value4:
                            type: text
                            label: "Value 4"
                        .value5:
                            type: text
                            label: "Value 5"
                        .value6:
                            type: text
                            label: "Value 6"
                        .value7:
                            type: text
                            label: "Value 7"
                        .value8:
                            type: text
                            label: "Value 8"
                        .value9:
                            type: text
                            label: "Value 9"
                        .value10:
                            type: text
                            label: "Value 10"
                        .value11:
                            type: text
                            label: "Value 11"
                        .value12:
                            type: text
                            label: "Value 12"
                        .value13:
                            type: text
                            label: "Value 13"
                        .value14:
                            type: text
                            label: "Value 14"
                        .value15:
                            type: text
                            label: "Value 15"
                        .value16:
                            type: text
                            label: "Value 16"
                        .value17:
                            type: text
                            label: "Value 17"
                        .value18:
                            type: text
                            label: "Value 18"

Create a new page using the blueprint and add 56 items. Try saving it on normal mode. If it works, add some more items and try saving. 56 should (just barely) cause the issue, though, with this blueprint.

rhukster commented 2 years ago

ya i’m not going to do that :).

try increasing your php’s post_max_size in php.ini

TheoAcker12 commented 2 years ago

That didn't help anything, but increasing max_input_vars did. I'm concerned that it was necessary though. Since this only happens when editing in normal mode, is there a way to post the input from normal mode the same way it is posted in expert mode?

And if not, or if that isn't something that can happen any time soon, what can I do on my end to minimize the issue? Based on a brief test it looks like setting toggleable: true for some of the fields helps if they aren't used, but hurts if more fields are used than not, so I'm not sure that's a very good solution.