Forum Replies Created
-
AuthorPosts
-
SIW
ParticipantI have submitted a PR to fix this https://github.com/wpmetabox/meta-box/pull/1526 so it should be fixed in the next update. It was caused (also by me...) when adding the localized validation messages https://github.com/wpmetabox/meta-box/pull/1525/files
December 24, 2022 at 1:13 AM in reply to: Nested conditional logic leads to incorrect validation of required fields #40015SIW
ParticipantHi Peter,
Thanks for your reply. You are right, scenario 2 indeed doesn't block saving.
Scenario 1 still block saving when only checking checkbox A.For reference the meta box to reproduce the problem:
$meta_boxes[] = [ 'title' => 'Conditional vibility', 'post_types' => 'post', 'fields' => [ [ 'name' => 'Checkbox A', 'id' => 'checkboxA', 'type' => 'checkbox', ], [ 'id' => 'group', 'type' => 'group', 'visible' => [ 'checkboxA', true ], 'fields' => [ [ 'id' => 'checkboxB', 'name' => __( 'Checkbox B', 'siw' ), 'type' => 'checkbox', ], [ 'id' => 'text', 'name' => __( 'Text', 'siw' ), 'type' => 'text', 'visible' => [ 'group_checkboxB', true ], 'required' => true, ], ], ], ], ];SIW
ParticipantHi Peter,
Yes, it has been fixed. The fact that is was still not working was because the script handle 'google-maps' was overwritten by another plugin but without loading the places library.
SIW
ParticipantIs there any ETA when this new version will be released?
SIW
ParticipantHi, thanks for your reply. I know I can do it this way, but that means that for every field I have to define the validation, even for fields that have default validations like required, email or number. By loading the localization files this is not necessary.
SIW
ParticipantHi, is there any ETA on this?
SIW
ParticipantHi Ahn,
For these 3 type the MetaBox version including the jQuery date and/or timepicker is always used. I cannot find a way to override this behavior.
December 19, 2019 at 4:25 AM in reply to: ✅Conditional Logic broken by new Frontend Submission release #17576SIW
ParticipantThis is caused by the check constant MB_FRONTEND_SUBMISSION_DIR in wp-content\plugins\meta-box-aio\vendor\meta-box\meta-box-conditional-logic\conditional-logic.php:
if ( ! is_admin() && ! defined( 'MB_FRONTEND_SUBMISSION_DIR' ) ) { return; }This constant is not used in Frond End Submission, but instead MBFS_DIR is defined.
However, changing this would result in the conditional logic scripts to be enqueued on all front end pages regardless of the presence of a front end form.
Wouldn't it be better to (instead of using the constant) look at the presence of conditions (just like is done for enqueueing the validation scripts)?SIW
ParticipantI think it should be possible to exclude hidden inputs using the ignore options of jQuery Validation.
I've tested this by changing:
ignore: ':not([class|="rwmb"])',in wp-content\plugins\meta-box\js\validate.js to
ignore: ':not([class|="rwmb"]), [data-visible="hidden"] .rwmb-input input',SIW
ParticipantI had the same problem and 'solved' it by not registering the setting page meta boxes when on a Mailpoet page:
if ( defined( 'WYSIJA_ITF' ) && WYSIJA_ITF ) { return; }SIW
ParticipantOk, thanks. I think I'll create a custom field then.
-
AuthorPosts