Commit c7594141 authored by Fabianx's avatar Fabianx

Issue #2747679 by david_garcia, pashupathi nath gajawada, izaaksom: Ajax form...

Issue #2747679 by david_garcia, pashupathi nath gajawada, izaaksom: Ajax form callbacks can only be global functions
parent b0420854
......@@ -58,6 +58,7 @@ Drupal 7.50, xxxx-xx-xx (development version)
language negotation.
- Fixed Drupal 7.36 regression: hidden field textarea #default_value is
ignored.
- Made it possible to use any callable as an ajax form callback.
Drupal 7.44, 2016-06-15
-----------------------
......
......@@ -394,7 +394,7 @@ function ajax_form_callback() {
if (!empty($form_state['triggering_element'])) {
$callback = $form_state['triggering_element']['#ajax']['callback'];
}
if (!empty($callback) && function_exists($callback)) {
if (!empty($callback) && is_callable($callback)) {
$result = $callback($form, $form_state);
if (!(is_array($result) && isset($result['#type']) && $result['#type'] == 'ajax')) {
......
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