Commit f4a817a4 authored by alexpott's avatar alexpott
Browse files

Issue #2399221 by bojanz: Throw a friendly error when the #ajax callback can't be resolved

parent d644718d
......@@ -99,7 +99,7 @@ public function content(Request $request) {
}
$callback = $form_state->prepareCallback($callback);
if (empty($callback) || !is_callable($callback)) {
throw new HttpException(500, t('Internal Server Error'));
throw new HttpException(500, 'The specified #ajax callback is empty or not callable.');
}
/** @var \Drupal\Core\Ajax\AjaxResponse $response */
$response = call_user_func_array($callback, [&$form, &$form_state]);
......
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