An error is occurring on one of my Field Groups

Support General An error is occurring on one of my Field Groups

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #34220
    MartinMartin
    Participant

    I have MB version 5.6.0 and AIO version 1.15.0. These are installed in a multisite system.

    Today I've had a report that a field group is no longer displaying. The problem seems to be that the settings for the field group are being blanked whenever the field group is updated.

    When I look in the postmeta table I can see a row with meta_key 'settings' which seems to store the details of the Location and Advanced location rules (and I assume other settings). Whether there is anything in the settings or not, pressing Update on the field group results in the meta_value getting set to an empty array (a:0:{}). The value for the meta_key 'data' also has the empty array.

    It should have the location set to Users and additional rules so that it appears for a specific edited user role and only for that role and admins to view it.

    This field group now no longer appears at all. I don't see it against the users in the Dashboard. I don't see it when set to appear using the shortcode in the front end (the field group shows but none of the data saved against it shows - it behaves like it hasn't been shown before which default values only). It also doesn't display at all when called via shortcode from Views.

    There are other field groups which are working correctly.

    This is the export of the field group that is in error - https://pastebin.com/Uz9P5wrB.

    This is an example of one of the other field groups that is working correctly still and has the same Location and Advanced location rules as the above should have - https://pastebin.com/wtMeBpBZ.

    Thanks.

    #34228
    Long NguyenLong Nguyen
    Moderator

    Hi Martin,

    You can follow this article to know how to increase the PHP setting max_input_vars, restart the server, and check this issue again. I've imported your field group to my local site but do not see any issue when setting the Location or Advanced Location Rules. Screen record
    https://monosnap.com/file/AXpYsYtzvw30WKDMOK0wxsXNjms0ka

    #34237
    MartinMartin
    Participant

    Thanks Long.

    I already have max_input_vars set to 10000 which has always been enough before. This is set in php.ini in the root of public_html. I'm assuming this is the right place for it. The file only contains the max_input_vars setting.

    #34255
    Long NguyenLong Nguyen
    Moderator

    Hi,

    The file php.ini should be in the server folder instead of the public_html folder. Refer to the article https://metabox.io/wordpress-custom-fields-not-saving-increase-max-input-vars/
    https://stackoverflow.com/questions/59621958/how-can-i-permanently-increase-max-input-vars-the-php-ini-approach-periodically

    you can try to increase it with a higher value, eg: 100000.

    #34264
    MartinMartin
    Participant

    It looks like the php.ini works fine where it is and changing the value there is changing the reported value from phpinfo(). Changing it to 100000 had no effect.

    One thing I have noticed is that the field group structure is as follows:

    1 - Parent
    2 - Group
    3 - Fields & Groups

    I counted the number of objects at the #3 here and there are exactly 100 of these in the group at #2. When I reduce this to 99 objects it correctly saved the settings but reintroducing any field type to take the count back to 100 caused it to fail.

    Is there a limit on the number of fields (ie array index limited to 2 digits perhaps) that can exist in a group like this? If so, how do I extend the limit?

    #34291
    Long NguyenLong Nguyen
    Moderator

    Hi Martin,

    There is no limit to creating the custom fields, it is just limited by the hosting/server capabilities. As you can see on the screen record above, I've imported your fields to my local site and it works as well without any errors.

    #34311
    MartinMartin
    Participant

    I thought it would be strange for such a limit to exist. Is there any avenue I could look at to investigate it with the host company that you know of? It seems too coincidental that any field triggering a 3 digit array index isn't something to do with it yet I can't think why such a limit would exist anywhere.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.