Skip to content

Commit a27ee62

Browse files
fix: condition for attach modal on edit group
Do not show the attach modal when the fields does not exists.
1 parent 756122a commit a27ee62

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

templates/admin/ppom-fields.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@
2525
$product_meta = array();
2626
$ppom_field_index = 1;
2727
$is_edit_screen = false;
28+
$is_new_group = false;
2829

2930
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'new' ) {
3031
$is_edit_screen = true;
32+
$is_new_group = true;
3133
}
3234
if ( isset( $_REQUEST['productmeta_id'] ) && $_REQUEST ['do_meta'] == 'edit' ) {
3335

@@ -542,7 +544,7 @@ class="dashicons dashicons-editor-help"></i></span>
542544
</select>
543545
</div>
544546

545-
<?php if ( $is_edit_screen ) { ?>
547+
<?php if ( $is_edit_screen && ! $is_new_group ) { ?>
546548
<a class="btn btn-sm btn-secondary ppom-products-modal"
547549
data-ppom_id="<?php echo esc_attr( $product_meta_id ); ?>"
548550
data-formmodal-id="ppom-product-modal"

0 commit comments

Comments
 (0)