-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
Issue Overview
Using the following nested settings fields for my custom Action, if i uncomment the commented default values and then try to disable them in the backend configuration the following happens.
Instead of showing all options as disabled, the default values are getting applied again. This happens only, if one fully disables all of the given options at the same time. Configurations where at least a single option keeps enabled are working normally.
Steps to Reproduce (for bugs)
class Ticket_Mail_Action extends Action{
// [...]
public function get_meta_fields() {
// settings fields for admin ui
$meta_fields = parent::get_meta_fields();
// mention that default values here lead to unexpected behaviour for fully disabled checkboxes
$meta_fields['enabled_generators'] = array(
'type' => 'group',
'label' => __('Enabled generated Attachments', 'wp_torro_tickets'),
'description' => __('Please select, which Attachments should be automatically generated and attached.', 'wp_torro_tickets'),
'fields' => array(
'pdf_ticket' => array(
'type' => 'checkbox',
'label' => __('append ticket as PDF file', 'wp_torro_tickets'),
// 'default' => true
),
'pkpass_ticket' => array(
'type' => 'checkbox',
'label' => __('append ticket as PKPass file', 'wp_torro_tickets'),
// 'default' => true
),
'pdf_bill' => array(
'type' => 'checkbox',
'label' => __('append bill as PDF file <i>(not yet implemented!)</i>', 'wp_torro_tickets'),
// 'default' => false
)
)
);
// [...]
}
// [...]
}Screenshots / Video
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
