[BUG] Empty fields at setting pages
-
Plugin version: 5.7.0
Situation: I use a Metabox settings page with the Metabox field group.Problem: In the settings page the content that I configured does not appear. The field group I have two images and a URL field. But no information that I add on the page is reflected (after I save, the content is all blank, as if I had not configured anything).
Test I did: I tested it by creating another configuration page and another custom field (completely from scratch) and first I did it with a single image field. This one worked. The image I chose was displayed after saving. But when I changed the field to a group of fields and added a single image, the problem I described happened.
Conclusion: From the code it is possible to verify that the data is being saved in the database because it is possible to get all the information, but in the configuration page generated by Metabox it is not getting the information from the group of fields correctly. Thank goodness this did not result in a critical PHP error.
Please fix it as soon as possible.
Thanks.This is the PHP code generated by Metabox from the settings I made.
<?php $groups = rwmb_meta( 'slider_desktop', [ 'object_type' => 'setting' ], 'slider_setting' ); foreach ( $groups as $group ) { // Field slider_image_desktop: $image_id = $group[ 'slider_image_desktop' ] ?? 0; $image = RWMB_Image_Field::file_info( $image_id, [ 'size' => 'thumbnail' ] ); ?> <h3>Logo</h3> <img src="<?= $image['url']; ?>"> <?php // Field slide_image_mobile: $image_id = $group[ 'slide_image_mobile' ] ?? 0; $image = RWMB_Image_Field::file_info( $image_id, [ 'size' => 'thumbnail' ] ); ?> <h3>Logo</h3> <img src="<?= $image['url']; ?>"> <?php // Field slider_desktop_link: echo $group[ 'slider_desktop_link' ] ?? ''; } ?>
- The topic ‘[BUG] Empty fields at setting pages’ is closed to new replies.