Commit eb7d6f05 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#206955 follow up by merlinofchaos: avoid misusing default values for image buttons

parent a44341a8
......@@ -985,7 +985,9 @@ function _form_builder_handle_input_element($form_id, &$form, &$form_state, $com
$form['#value'] = $function($form);
// Final catch. If we haven't set a value yet, use the explicit default value.
if (!isset($form['#value'])) {
// Avoid image buttons (which come with garbage value), so we only get value
// for the button actually clicked.
if (!isset($form['#value']) && empty($form['#has_garbage_value'])) {
$form['#value'] = isset($form['#default_value']) ? $form['#default_value'] : '';
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