Hello, Metabox support.
We have created Event CPT with multiple date fields, one of which is a cloneable and sortable date field, saving in Ymd format.
Upon saving, it results in critical error. Please see the log below.
Error Details
=============
An error of type E_ERROR was caused in line 216 of the file /home/care-digital/webapps/demo/wp-content/plugins/meta-box/inc/fields/datetime.php. Error message: Uncaught TypeError: RWMB_Datetime_Field::from_save_format(): Return value must be of type string, null returned in /home/care-digital/webapps/demo/wp-content/plugins/meta-box/inc/fields/datetime.php:216
Stack trace:
#0 [internal function]: RWMB_Datetime_Field::from_save_format()
#1 /home/care-digital/webapps/demo/wp-content/plugins/meta-box/vendor/meta-box/support/Arr.php(22): call_user_func_array()
#2 [internal function]: MetaBox\Support\Arr::MetaBox\Support\{closure}()
#3 /home/care-digital/webapps/demo/wp-content/plugins/meta-box/vendor/meta-box/support/Arr.php(20): array_map()
#4 /home/care-digital/webapps/demo/wp-content/plugins/meta-box/inc/fields/datetime.php(185): MetaBox\Support\Arr::map()
#5 /home/care-digital/webapps/demo/wp-content/plugins/meta-box/inc/field.php(541): RWMB_Datetime_Field::meta()
#6 /home/care-digital/webapps/demo/wp-content/plugins/meta-box/inc/field.php(25): RWMB_Field::call()
#7 /home/care-digital/webapps/demo/wp-content/plugins/meta-box/inc/field.php(541): RWMB_Field::show()
#8 /home/care-digital/webapps/demo/wp-content/plugins/meta-box/inc/meta-box.php(218): RWMB_Field::call()
#9 /home/care-digital/webapps/demo/wp-admin/includes/template.php(1456): RW_Meta_Box->show()
#10 /home/care-digital/webapps/demo/wp-admin/edit-form-advanced.php(722): do_meta_boxes()
#11 /home/care-digital/webapps/demo/wp-admin/post.php(206): require('..')
#12 {main}
thrown
All the other date fields are fine when left empty, but not this cloneable field. Deleting this field solves the issue. Any help is appreciated.
Best regards,
Wirat