Commit f7083334 authored by Andrew Hunt's avatar Andrew Hunt

Give buttons a value when the submitted value is used to identify them

parent 98da7d67
......@@ -54,7 +54,10 @@ class CRM_Admin_Form_Preferences_Display extends CRM_Admin_Form_Preferences {
'xbutton',
'ckeditor_config',
CRM_Core_Page::crmIcon('fa-wrench') . ' ' . ts('Configure CKEditor'),
['type' => 'submit']
[
'type' => 'submit',
'value' => 1,
]
);
$editOptions = CRM_Core_OptionGroup::values('contact_edit_options', FALSE, FALSE, FALSE, 'AND v.filter = 0');
......
......@@ -176,7 +176,10 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form {
$this->addElement('xbutton',
$forceSave,
ts('Ignore Mismatch & Process the Batch?'),
['type' => 'submit']
[
'type' => 'submit',
'value' => 1,
]
);
$this->addButtons([
......
......@@ -68,6 +68,7 @@ class CRM_Contact_Form_Task_AddToParentClass extends CRM_Contact_Form_Task {
$buttonAttrs = [
'type' => 'submit',
'class' => 'crm-form-submit',
'value' => 1,
];
$this->addElement('xbutton', $this->getButtonName('refresh'), ts('Search'), $buttonAttrs);
$this->addElement('xbutton', $this->getButtonName('cancel'), ts('Cancel'), $buttonAttrs);
......
......@@ -322,6 +322,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
[
'type' => 'submit',
'class' => 'submit-link',
'value' => 1,
]
);
......@@ -559,6 +560,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
$form->addElement('xbutton', "addMore[$x]", ts('Another search field'), [
'type' => 'submit',
'class' => 'submit-link',
'value' => 1,
]);
}
//end of block for
......
......@@ -668,6 +668,13 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
$attrs = ['class' => 'crm-form-submit'] + (array) CRM_Utils_Array::value('js', $button);
// A lot of forms use the hacky method of looking at
// `$params['button name']` (dating back to them being inputs with a
// "value" of the button label) rather than looking at
// `$this->controller->getButtonName()`. It makes sense to give buttons a
// value by default as a precaution.
$attrs['value'] = 1;
if (!empty($button['class'])) {
$attrs['class'] .= ' ' . $button['class'];
}
......
......@@ -359,6 +359,7 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
[
'type' => 'submit',
'class' => 'crm-form-submit cancel',
'value' => 1,
]
);
if (Civi::settings()->get('deferred_revenue_enabled')) {
......
......@@ -209,7 +209,10 @@ SELECT module,is_reserved
if (($this->_multiRecord & CRM_Core_Action::DELETE) && $this->_recordExists) {
$this->_deleteButtonName = $this->getButtonName('upload', 'delete');
$this->addElement('xbutton', $this->_deleteButtonName, ts('Delete'), ['type' => 'submit']);
$this->addElement('xbutton', $this->_deleteButtonName, ts('Delete'), [
'type' => 'submit',
'value' => 1,
]);
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment