AIO 1.31.0 Not Saving Group Fields via API
Support › Meta Box AIO › AIO 1.31.0 Not Saving Group Fields via APIResolved
- This topic has 7 replies, 3 voices, and was last updated 3 months ago by
Cameron.
-
AuthorPosts
-
November 23, 2024 at 4:19 AM #47015
Cameron
ParticipantThere is a bug in AIO 1.31.0 that will not save a Group field when using a POST API call to /posts/post_ID. The payload will look correct on the output response, but if you GET the same post immediately after, the Group field is unchanged.
Rolling back to AIO 1.30.5 fixes the problem.
November 26, 2024 at 6:57 AM #47022Peter
ModeratorHello Cameron,
Can you share the
group
field settings and sub-fields that you try to update the value via POST API? I try with simplegroup
field'fields' => [ [ 'name' => __( 'Group', 'your-text-domain' ), 'id' => $prefix . 'group_ubce2rqmfm', 'type' => 'group', 'fields' => [ [ 'name' => __( 'Text', 'your-text-domain' ), 'id' => $prefix . 'text_wulikp8w5km', 'type' => 'text', ], ], ], ],
and I can update the subfield
text
value with POST API properly when using the latest version MB AIO 1.31.0.
Also, do you use any caching plugins on your site or on your hosting? Please disable them all and recheck this issue.November 28, 2024 at 2:25 AM #47049Cameron
ParticipantHi Peter,
I have a Group called
Highlights Group
with fields calledHighlights
within. This Custom Field is stored in a Custom Table.I've previously been updating it successfully like this:
{ "meta_box": { "HighlightsGroup": [ { "highlight": "This is a test" } ] } }
The output payload shows as successful, but using a GET command right after the field will not be updated.
This stopped working in 1.31.0 but works in 1.30.5 .
November 28, 2024 at 11:12 PM #47059Peter
ModeratorHello,
Thanks for the details. I also see the data is not inserted into the custom table. There could be an issue with the Rest API and custom table in the new version. I will inform the development team to check and fix it soon.
January 2, 2025 at 4:17 AM #47280Cameron
ParticipantPeter, any chance this was fixed in 1.31.1?
January 2, 2025 at 2:55 PM #47283Tan Nguyen
ParticipantDear Cameron,
I have checked MB Rest API and found no issues, please make sure you have set
'clone' => true
to **HighlightsGroup** field. Here is the meta box that have similar structure with yours.add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) { $meta_boxes[] = [ 'title' => 'Test', 'fields' => [ [ 'name' => 'HighlightsGroup', 'id' => 'HighlightsGroup', 'type' => 'group', 'clone' => true, 'fields' => [ [ 'name' => 'highlight', 'id' => 'highlight', 'type' => 'text', ], ] ], ], ]; return $meta_boxes; } );
Since your **HighlightsGroup** field expects an array, you have to set clone => true.
Otherwise, if you don't want cloneable group, here is the correct json format:
{ "meta_box": { "HighlightsGroup": { "highlight": "This is another test" } } }
Cheers!
January 12, 2025 at 10:31 AM #47373Cameron
ParticipantHello, this is still an issue in AIO 1.31.1.
I send this payload:
{ "meta_box": { "HighlightsGroup": [ { "highlight": "This is a Test" } ] } }
...the response received will be correct and seems to be updated, but when you view the actual post or database, nothing has changed.
Roll back to 1.30.5 and it works!
Tan, I double checked that
clone
is set to true when I tested with both versions. It will work correctly in 1.30.5, just not 1.31.0 or 1.31.1.January 12, 2025 at 11:31 PM #47374Cameron
ParticipantCan we mark this as not resolved?
-
AuthorPosts
- You must be logged in to reply to this topic.