Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
9c306c1c
Commit
9c306c1c
authored
Nov 17, 2013
by
Dries Buytaert
Browse files
Issue
#2122019
by damiankloip: Remove include_file() logic and getMenuItem() from FormBuilder.
parent
dd190fd8
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/lib/Drupal/Core/Form/FormBuilder.php
View file @
9c306c1c
...
...
@@ -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().
*/
...
...
core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php
View file @
9c306c1c
...
...
@@ -635,13 +635,6 @@ protected function drupalInstallationAttempted() {
return
FALSE
;
}
/**
* {@inheritdoc}
*/
protected
function
menuGetItem
()
{
return
FALSE
;
}
/**
* {@inheritdoc}
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment