diff --git a/core/lib/Drupal/Core/Form/FormBuilder.php b/core/lib/Drupal/Core/Form/FormBuilder.php index cbaf9080830a827ae55b7c795c67fc6cb9fdc547..036339987538a9cd7e40064baed4faecdbe2fec1 100644 --- a/core/lib/Drupal/Core/Form/FormBuilder.php +++ b/core/lib/Drupal/Core/Form/FormBuilder.php @@ -478,21 +478,6 @@ public function retrieveForm($form_id, &$form_state) { // Record the $form_id. $form_state['build_info']['form_id'] = $form_id; - // Record the filepath of the include file containing the original form, so - // the form builder callbacks can be loaded when the form is being rebuilt - // from cache on a different path (such as 'system/ajax'). See - // self::getCache(). Don't do this in maintenance mode as Drupal may not be - // fully bootstrapped (i.e. during installation) in which case - // menu_get_item() is not available. - if (!isset($form_state['build_info']['files']['menu']) && !defined('MAINTENANCE_MODE')) { - $item = $this->menuGetItem(); - if (!empty($item['include_file'])) { - // Do not use form_load_include() here, as the file is already loaded. - // Anyway, self::getCache() is able to handle filepaths too. - $form_state['build_info']['files']['menu'] = $item['include_file']; - } - } - // We save two copies of the incoming arguments: one for modules to use // when mapping form ids to constructor functions, and another to pass to // the constructor function itself. @@ -1701,15 +1686,6 @@ protected function drupalInstallationAttempted() { return drupal_installation_attempted(); } - /** - * Wraps menu_get_item(). - * - * @return array|bool - */ - protected function menuGetItem() { - return menu_get_item(); - } - /** * Wraps watchdog(). */ diff --git a/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php b/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php index b0779bd707eb7c97f0eca499e48b14bd725cefdf..20c13df8b56980bab521debfcc52b0429ef19548 100644 --- a/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php +++ b/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php @@ -635,13 +635,6 @@ protected function drupalInstallationAttempted() { return FALSE; } - /** - * {@inheritdoc} - */ - protected function menuGetItem() { - return FALSE; - } - /** * {@inheritdoc} */