Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By aspilicious on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Issue links:
Description:
The drupal_json_output() function of Drupal is removed in favor of Symfony\Component\HttpFoundation\JsonResponse.
Drupal 7
$options = _menu_get_options(menu_get_menus(), $available_menus, array('mlid' => 0));
drupal_json_output($options);
Drupal 8
use Symfony\Component\HttpFoundation\JsonResponse;
// ...
$options = _menu_get_options(menu_get_menus(), $available_menus, array('mlid' => 0));
return new JsonResponse($options);
Impacts:
Module developers