summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--core/authorize.php2
-rw-r--r--core/includes/ajax.inc2
-rw-r--r--core/includes/form.inc18
-rw-r--r--core/lib/Drupal/Core/Form/FormBuilderInterface.php8
-rw-r--r--core/modules/action/lib/Drupal/action/ActionListBuilder.php2
-rw-r--r--core/modules/ban/lib/Drupal/ban/Form/BanAdmin.php5
-rw-r--r--core/modules/block/lib/Drupal/block/BlockListBuilder.php2
-rw-r--r--core/modules/file/tests/file_module_test/lib/Drupal/file_module_test/Form/FileModuleTestForm.php2
-rw-r--r--core/modules/language/language.admin.inc2
-rw-r--r--core/modules/language/tests/language_elements_test/lib/Drupal/language_elements_test/Form/LanguageElementsTestForm.php4
-rw-r--r--core/modules/locale/lib/Drupal/locale/Form/LocaleForm.php4
-rw-r--r--core/modules/path/path.admin.inc6
-rw-r--r--core/modules/search/lib/Drupal/search/Plugin/Block/SearchBlock.php2
-rw-r--r--core/modules/search/lib/Drupal/search/Plugin/SearchInterface.php4
-rw-r--r--core/modules/shortcut/lib/Drupal/shortcut/Form/ShortcutForm.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Form/CheckboxTest.php2
-rw-r--r--core/modules/system/system.api.php16
-rw-r--r--core/modules/system/tests/modules/ajax_forms_test/lib/Drupal/ajax_forms_test/Form/AjaxFormsTestForm.php8
-rw-r--r--core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestForm.php6
-rw-r--r--core/modules/system/tests/modules/database_test/lib/Drupal/database_test/Form/DatabaseTestForm.php2
-rw-r--r--core/modules/system/tests/modules/form_test/lib/Drupal/form_test/Form/FormTestForm.php86
-rw-r--r--core/modules/update/lib/Drupal/update/Form/UpdateForm.php14
-rw-r--r--core/modules/user/lib/Drupal/user/Form/UserForm.php2
-rw-r--r--core/modules/user/lib/Drupal/user/Plugin/Block/UserLoginBlock.php2
24 files changed, 102 insertions, 101 deletions
diff --git a/core/authorize.php b/core/authorize.php
index 2ddd7d6262a..97fbe24df98 100644
--- a/core/authorize.php
+++ b/core/authorize.php
@@ -139,7 +139,7 @@ if (authorize_access_allowed()) {
}
elseif (!$batch = batch_get()) {
// We have a batch to process, show the filetransfer form.
- $elements = drupal_get_form('authorize_filetransfer_form');
+ $elements = \Drupal::formBuilder()->getForm('authorize_filetransfer_form');
$output = drupal_render($elements);
}
}
diff --git a/core/includes/ajax.inc b/core/includes/ajax.inc
index 7a984726173..7ab2059fc87 100644
--- a/core/includes/ajax.inc
+++ b/core/includes/ajax.inc
@@ -61,7 +61,7 @@
* @link http://drupal.org/project/examples Examples module @endlink follows:
* @code
* function main_page() {
- * return drupal_get_form('ajax_example_simplest');
+ * return \Drupal::formBuilder()->getForm('ajax_example_simplest');
* }
*
* function ajax_example_simplest($form, &$form_state) {
diff --git a/core/includes/form.inc b/core/includes/form.inc
index 8f03f772b74..d290b4f4495 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -43,18 +43,18 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
* presentation, while simplifying code and reducing the amount of HTML that
* must be explicitly generated by modules.
*
- * The primary function used with forms is drupal_get_form(), which is
- * used for forms presented interactively to a user. Forms can also be built and
- * submitted programmatically without any user input using the
+ * The primary function used with forms is \Drupal::formBuilder()->getForm(),
+ * which is used for forms presented interactively to a user. Forms can also be
+ * built and submitted programmatically without any user input using the
* drupal_form_submit() function.
*
- * drupal_get_form() handles retrieving, processing, and displaying a rendered
- * HTML form for modules automatically.
+ * \Drupal::formBuilder()->getForm() handles retrieving, processing, and
+ * displaying a rendered HTML form for modules automatically.
*
- * Here is an example of how to use drupal_get_form() and a form builder
- * function:
+ * Here is an example of how to use \Drupal::formBuilder()->getForm() and a
+ * form builder function:
* @code
- * $form = drupal_get_form('my_module_example_form');
+ * $form = \Drupal::formBuilder()->getForm('my_module_example_form');
* ...
* function my_module_example_form($form, &$form_state) {
* $form['submit'] = array(
@@ -74,7 +74,7 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
* Or with any number of additional arguments:
* @code
* $extra = "extra";
- * $form = drupal_get_form('my_module_example_form', $extra);
+ * $form = \Drupal::formBuilder()->getForm('my_module_example_form', $extra);
* ...
* function my_module_example_form($form, &$form_state, $extra) {
* $form['submit'] = array(
diff --git a/core/lib/Drupal/Core/Form/FormBuilderInterface.php b/core/lib/Drupal/Core/Form/FormBuilderInterface.php
index 0e318bbb7e3..04ebcca476c 100644
--- a/core/lib/Drupal/Core/Form/FormBuilderInterface.php
+++ b/core/lib/Drupal/Core/Form/FormBuilderInterface.php
@@ -41,10 +41,10 @@ interface FormBuilderInterface extends FormErrorInterface {
* - The name of a function that builds the form.
* @param ...
* Any additional arguments are passed on to the functions called by
- * drupal_get_form(), including the unique form constructor function. For
- * example, the node_edit form requires that a node object is passed in here
- * when it is called. These are available to implementations of
- * hook_form_alter() and hook_form_FORM_ID_alter() as the array
+ * \Drupal::formBuilder()->getForm(), including the unique form constructor
+ * function. For example, the node_edit form requires that a node object is
+ * passed in here when it is called. These are available to implementations
+ * of hook_form_alter() and hook_form_FORM_ID_alter() as the array
* $form_state['build_info']['args'].
*
* @return array
diff --git a/core/modules/action/lib/Drupal/action/ActionListBuilder.php b/core/modules/action/lib/Drupal/action/ActionListBuilder.php
index 76c4f2f6bb9..446cc975318 100644
--- a/core/modules/action/lib/Drupal/action/ActionListBuilder.php
+++ b/core/modules/action/lib/Drupal/action/ActionListBuilder.php
@@ -118,7 +118,7 @@ class ActionListBuilder extends ConfigEntityListBuilder {
if (!$this->hasConfigurableActions) {
unset($build['action_table']['#header']['operations']);
}
- $build['action_admin_manage_form'] = drupal_get_form('Drupal\action\Form\ActionAdminManageForm');
+ $build['action_admin_manage_form'] = \Drupal::formBuilder()->getForm('Drupal\action\Form\ActionAdminManageForm');
return $build;
}
diff --git a/core/modules/ban/lib/Drupal/ban/Form/BanAdmin.php b/core/modules/ban/lib/Drupal/ban/Form/BanAdmin.php
index bc83c541026..b6e4c56c19d 100644
--- a/core/modules/ban/lib/Drupal/ban/Form/BanAdmin.php
+++ b/core/modules/ban/lib/Drupal/ban/Form/BanAdmin.php
@@ -50,8 +50,9 @@ class BanAdmin extends FormBase {
* {@inheritdoc}
*
* @param string $default_ip
- * (optional) IP address to be passed on to drupal_get_form() for use as the
- * default value of the IP address form field.
+ * (optional) IP address to be passed on to
+ * \Drupal::formBuilder()->getForm() for use as the default value of the IP
+ * address form field.
*/
public function buildForm(array $form, array &$form_state, $default_ip = '') {
$rows = array();
diff --git a/core/modules/block/lib/Drupal/block/BlockListBuilder.php b/core/modules/block/lib/Drupal/block/BlockListBuilder.php
index 1b93f8cbfca..8db9c6ac99c 100644
--- a/core/modules/block/lib/Drupal/block/BlockListBuilder.php
+++ b/core/modules/block/lib/Drupal/block/BlockListBuilder.php
@@ -119,7 +119,7 @@ class BlockListBuilder extends ConfigEntityListBuilder implements FormInterface
// If no theme was specified, use the current theme.
$this->theme = $theme ?: $GLOBALS['theme_key'];
- return drupal_get_form($this);
+ return \Drupal::formBuilder()->getForm($this);
}
/**
diff --git a/core/modules/file/tests/file_module_test/lib/Drupal/file_module_test/Form/FileModuleTestForm.php b/core/modules/file/tests/file_module_test/lib/Drupal/file_module_test/Form/FileModuleTestForm.php
index fdd3cdbcb86..cdfd4742be5 100644
--- a/core/modules/file/tests/file_module_test/lib/Drupal/file_module_test/Form/FileModuleTestForm.php
+++ b/core/modules/file/tests/file_module_test/lib/Drupal/file_module_test/Form/FileModuleTestForm.php
@@ -16,7 +16,7 @@ class FileModuleTestForm {
* @todo Remove file_module_test_form().
*/
public function managedFileTest($tree, $extended, $multiple, $default_fids) {
- return drupal_get_form('file_module_test_form', $tree, $extended, $multiple, $default_fids);
+ return \Drupal::formBuilder()->getForm('file_module_test_form', $tree, $extended, $multiple, $default_fids);
}
}
diff --git a/core/modules/language/language.admin.inc b/core/modules/language/language.admin.inc
index b506136ac89..c7dbb8dc268 100644
--- a/core/modules/language/language.admin.inc
+++ b/core/modules/language/language.admin.inc
@@ -157,7 +157,7 @@ function theme_language_negotiation_configure_browser_form_table($variables) {
* Use \Drupal\language\Controller\LanguageController::contentSettings().
*/
function language_content_settings_page() {
- return drupal_get_form('language_content_settings_form', language_entity_supported());
+ return \Drupal::formBuilder()->getForm('language_content_settings_form', language_entity_supported());
}
/**
diff --git a/core/modules/language/tests/language_elements_test/lib/Drupal/language_elements_test/Form/LanguageElementsTestForm.php b/core/modules/language/tests/language_elements_test/lib/Drupal/language_elements_test/Form/LanguageElementsTestForm.php
index 15dd084d4f7..010b472e005 100644
--- a/core/modules/language/tests/language_elements_test/lib/Drupal/language_elements_test/Form/LanguageElementsTestForm.php
+++ b/core/modules/language/tests/language_elements_test/lib/Drupal/language_elements_test/Form/LanguageElementsTestForm.php
@@ -18,7 +18,7 @@ class LanguageElementsTestForm {
* @todo Remove language_elements_configuration_element().
*/
public function configFormElement() {
- return drupal_get_form('language_elements_configuration_element');
+ return \Drupal::formBuilder()->getForm('language_elements_configuration_element');
}
/**
@@ -27,7 +27,7 @@ class LanguageElementsTestForm {
* @todo Remove language_element_tests_configuration_element_test().
*/
public function configFormElementTest() {
- return drupal_get_form('language_elements_configuration_element_test');
+ return \Drupal::formBuilder()->getForm('language_elements_configuration_element_test');
}
}
diff --git a/core/modules/locale/lib/Drupal/locale/Form/LocaleForm.php b/core/modules/locale/lib/Drupal/locale/Form/LocaleForm.php
index aaa0bfac7a0..41857d09bfa 100644
--- a/core/modules/locale/lib/Drupal/locale/Form/LocaleForm.php
+++ b/core/modules/locale/lib/Drupal/locale/Form/LocaleForm.php
@@ -18,7 +18,7 @@ class LocaleForm {
*/
public function import() {
module_load_include('bulk.inc', 'locale');
- return drupal_get_form('locale_translate_import_form');
+ return \Drupal::formBuilder()->getForm('locale_translate_import_form');
}
/**
@@ -28,7 +28,7 @@ class LocaleForm {
*/
public function status() {
module_load_include('pages.inc', 'locale');
- return drupal_get_form('locale_translation_status_form');
+ return \Drupal::formBuilder()->getForm('locale_translation_status_form');
}
}
diff --git a/core/modules/path/path.admin.inc b/core/modules/path/path.admin.inc
index d22fe66d49c..76bc1dc74ac 100644
--- a/core/modules/path/path.admin.inc
+++ b/core/modules/path/path.admin.inc
@@ -19,7 +19,7 @@ use Drupal\Component\Utility\String;
*/
function path_admin_overview($keys = NULL) {
// Add the filter form above the overview table.
- $build['path_admin_filter_form'] = drupal_get_form('path_admin_filter_form', $keys);
+ $build['path_admin_filter_form'] = \Drupal::formBuilder()->getForm('path_admin_filter_form', $keys);
// Enable language column if language.module is enabled or if we have any
// alias with a language.
$alias_exists = (bool) db_query_range('SELECT 1 FROM {url_alias} WHERE langcode <> :langcode', 0, 1, array(':langcode' => Language::LANGCODE_NOT_SPECIFIED))->fetchField();
@@ -116,11 +116,11 @@ function path_admin_overview($keys = NULL) {
*/
function path_admin_edit($path = array()) {
if ($path) {
- $output = drupal_get_form('path_admin_form', $path);
+ $output = \Drupal::formBuilder()->getForm('path_admin_form', $path);
$output['#title'] = String::checkPlain($path['alias']);
}
else {
- $output = drupal_get_form('path_admin_form');
+ $output = \Drupal::formBuilder()->getForm('path_admin_form');
}
return $output;
diff --git a/core/modules/search/lib/Drupal/search/Plugin/Block/SearchBlock.php b/core/modules/search/lib/Drupal/search/Plugin/Block/SearchBlock.php
index aa33cbfa837..c2e3e512c8c 100644
--- a/core/modules/search/lib/Drupal/search/Plugin/Block/SearchBlock.php
+++ b/core/modules/search/lib/Drupal/search/Plugin/Block/SearchBlock.php
@@ -34,7 +34,7 @@ class SearchBlock extends BlockBase {
* {@inheritdoc}
*/
public function build() {
- return drupal_get_form('Drupal\search\Form\SearchBlockForm');
+ return \Drupal::formBuilder()->getForm('Drupal\search\Form\SearchBlockForm');
}
}
diff --git a/core/modules/search/lib/Drupal/search/Plugin/SearchInterface.php b/core/modules/search/lib/Drupal/search/Plugin/SearchInterface.php
index 2ff0ad70c57..1f3f2c1ce60 100644
--- a/core/modules/search/lib/Drupal/search/Plugin/SearchInterface.php
+++ b/core/modules/search/lib/Drupal/search/Plugin/SearchInterface.php
@@ -93,8 +93,8 @@ interface SearchInterface extends PluginInspectionInterface {
* Nested array of form elements that comprise the form.
* @param array $form_state
* A keyed array containing the current state of the form. The arguments
- * that drupal_get_form() was originally called with are available in the
- * array $form_state['build_info']['args'].
+ * that \Drupal::formBuilder()->getForm() was originally called with are
+ * available in the array $form_state['build_info']['args'].
*/
public function searchFormAlter(array &$form, array &$form_state);
diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Form/ShortcutForm.php b/core/modules/shortcut/lib/Drupal/shortcut/Form/ShortcutForm.php
index 9c2cf5e0351..4f556b7e33e 100644
--- a/core/modules/shortcut/lib/Drupal/shortcut/Form/ShortcutForm.php
+++ b/core/modules/shortcut/lib/Drupal/shortcut/Form/ShortcutForm.php
@@ -21,7 +21,7 @@ class ShortcutForm {
*/
public function overview(UserInterface $user) {
module_load_include('admin.inc', 'shortcut');
- return drupal_get_form('shortcut_set_switch', $user);
+ return \Drupal::formBuilder()->getForm('shortcut_set_switch', $user);
}
}
diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/CheckboxTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/CheckboxTest.php
index 228c5762126..f15b3d1f527 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/CheckboxTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/CheckboxTest.php
@@ -37,7 +37,7 @@ class CheckboxTest extends WebTestBase {
// #return_value, with the exception of integer 0, which is not supported.
// @see form_process_checkbox().
foreach (array('0', '', 1, '1', 'foobar', '1foobar') as $return_value) {
- $form_array = drupal_get_form('form_test_checkbox_type_juggling', $default_value, $return_value);
+ $form_array = \Drupal::formBuilder()->getForm('form_test_checkbox_type_juggling', $default_value, $return_value);
$form = drupal_render($form_array);
if ($default_value === TRUE) {
$checked = TRUE;
diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php
index 4c95a00d298..b995551e9cd 100644
--- a/core/modules/system/system.api.php
+++ b/core/modules/system/system.api.php
@@ -699,8 +699,8 @@ function hook_page_alter(&$page) {
* Nested array of form elements that comprise the form.
* @param $form_state
* A keyed array containing the current state of the form. The arguments
- * that drupal_get_form() was originally called with are available in the
- * array $form_state['build_info']['args'].
+ * that \Drupal::formBuilder()->getForm() was originally called with are
+ * available in the array $form_state['build_info']['args'].
* @param $form_id
* String representing the name of the form itself. Typically this is the
* name of the function that generated the form.
@@ -738,8 +738,8 @@ function hook_form_alter(&$form, &$form_state, $form_id) {
* Nested array of form elements that comprise the form.
* @param $form_state
* A keyed array containing the current state of the form. The arguments
- * that drupal_get_form() was originally called with are available in the
- * array $form_state['build_info']['args'].
+ * that \Drupal::formBuilder()->getForm() was originally called with are
+ * available in the array $form_state['build_info']['args'].
* @param $form_id
* String representing the name of the form itself. Typically this is the
* name of the function that generated the form.
@@ -765,10 +765,10 @@ function hook_form_FORM_ID_alter(&$form, &$form_state, $form_id) {
/**
* Provide a form-specific alteration for shared ('base') forms.
*
- * By default, when drupal_get_form() is called, Drupal looks for a function
- * with the same name as the form ID, and uses that function to build the form.
- * In contrast, base forms allow multiple form IDs to be mapped to a single base
- * (also called 'factory') form function.
+ * By default, when \Drupal::formBuilder()->getForm() is called, Drupal looks
+ * for a function with the same name as the form ID, and uses that function to
+ * build the form. In contrast, base forms allow multiple form IDs to be mapped
+ * to a single base (also called 'factory') form function.
*
* Modules can implement hook_form_BASE_FORM_ID_alter() to modify a specific
* base form, rather than implementing hook_form_alter() and checking for
diff --git a/core/modules/system/tests/modules/ajax_forms_test/lib/Drupal/ajax_forms_test/Form/AjaxFormsTestForm.php b/core/modules/system/tests/modules/ajax_forms_test/lib/Drupal/ajax_forms_test/Form/AjaxFormsTestForm.php
index 3a231ee9a8e..01f9e93eb6b 100644
--- a/core/modules/system/tests/modules/ajax_forms_test/lib/Drupal/ajax_forms_test/Form/AjaxFormsTestForm.php
+++ b/core/modules/system/tests/modules/ajax_forms_test/lib/Drupal/ajax_forms_test/Form/AjaxFormsTestForm.php
@@ -16,28 +16,28 @@ class AjaxFormsTestForm {
* @todo Remove ajax_forms_test_simple_form().
*/
public function getForm() {
- return drupal_get_form('ajax_forms_test_simple_form');
+ return \Drupal::formBuilder()->getForm('ajax_forms_test_simple_form');
}
/**
* @todo Remove ajax_forms_test_ajax_commands_form().
*/
public function commandsForm() {
- return drupal_get_form('ajax_forms_test_ajax_commands_form');
+ return \Drupal::formBuilder()->getForm('ajax_forms_test_ajax_commands_form');
}
/**
* @todo Remove ajax_forms_test_validation_form().
*/
public function validationForm() {
- return drupal_get_form('ajax_forms_test_validation_form');
+ return \Drupal::formBuilder()->getForm('ajax_forms_test_validation_form');
}
/**
* @todo Remove ajax_forms_test_lazy_load_form().
*/
public function lazyLoadForm() {
- return drupal_get_form('ajax_forms_test_lazy_load_form');
+ return \Drupal::formBuilder()->getForm('ajax_forms_test_lazy_load_form');
}
}
diff --git a/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestForm.php b/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestForm.php
index af9dbc95771..fd015ff872d 100644
--- a/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestForm.php
+++ b/core/modules/system/tests/modules/batch_test/lib/Drupal/batch_test/Form/BatchTestForm.php
@@ -16,21 +16,21 @@ class BatchTestForm {
* @todo Remove batch_test_simple_form().
*/
public function testForm() {
- return drupal_get_form('batch_test_simple_form');
+ return \Drupal::formBuilder()->getForm('batch_test_simple_form');
}
/**
* @todo Remove batch_test_multistep_form().
*/
public function testMultistepForm() {
- return drupal_get_form('batch_test_multistep_form');
+ return \Drupal::formBuilder()->getForm('batch_test_multistep_form');
}
/**
* @todo Remove batch_test_chained_form().
*/
public function testChainedForm() {
- return drupal_get_form('batch_test_chained_form');
+ return \Drupal::formBuilder()->getForm('batch_test_chained_form');
}
}
diff --git a/core/modules/system/tests/modules/database_test/lib/Drupal/database_test/Form/DatabaseTestForm.php b/core/modules/system/tests/modules/database_test/lib/Drupal/database_test/Form/DatabaseTestForm.php
index 4ec7f5007a3..2923faf872c 100644
--- a/core/modules/system/tests/modules/database_test/lib/Drupal/database_test/Form/DatabaseTestForm.php
+++ b/core/modules/system/tests/modules/database_test/lib/Drupal/database_test/Form/DatabaseTestForm.php
@@ -16,7 +16,7 @@ class DatabaseTestForm {
* @todo Remove database_test_theme_tablesort().
*/
public function testTablesortDefaultSort() {
- return drupal_get_form('database_test_theme_tablesort');
+ return \Drupal::formBuilder()->getForm('database_test_theme_tablesort');
}
}
diff --git a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/Form/FormTestForm.php b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/Form/FormTestForm.php
index 7b139322d7d..aaacf4050fc 100644
--- a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/Form/FormTestForm.php
+++ b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/Form/FormTestForm.php
@@ -18,7 +18,7 @@ class FormTestForm {
* @todo Remove form_test_alter_form().
*/
public function alterForm() {
- return drupal_get_form('form_test_alter_form');
+ return \Drupal::formBuilder()->getForm('form_test_alter_form');
}
/**
@@ -27,7 +27,7 @@ class FormTestForm {
* @todo Remove form_test_validate_form().
*/
public function validateForm() {
- return drupal_get_form('form_test_validate_form');
+ return \Drupal::formBuilder()->getForm('form_test_validate_form');
}
/**
@@ -36,7 +36,7 @@ class FormTestForm {
* @todo Remove form_test_validate_required_form().
*/
public function validateRequiredForm() {
- return drupal_get_form('form_test_validate_required_form');
+ return \Drupal::formBuilder()->getForm('form_test_validate_required_form');
}
/**
@@ -45,7 +45,7 @@ class FormTestForm {
* @todo Remove form_test_validate_required_form_no_title().
*/
public function validateRequiredFormNoTitle() {
- return drupal_get_form('form_test_validate_required_form_no_title');
+ return \Drupal::formBuilder()->getForm('form_test_validate_required_form_no_title');
}
/**
@@ -54,7 +54,7 @@ class FormTestForm {
* @todo Remove form_test_limit_validation_errors_form().
*/
public function validateFormWithErrorSuppression() {
- return drupal_get_form('form_test_limit_validation_errors_form');
+ return \Drupal::formBuilder()->getForm('form_test_limit_validation_errors_form');
}
/**
@@ -63,7 +63,7 @@ class FormTestForm {
* @todo Remove form_test_pattern_form().
*/
public function validatePattern() {
- return drupal_get_form('form_test_pattern_form');
+ return \Drupal::formBuilder()->getForm('form_test_pattern_form');
}
/**
@@ -72,7 +72,7 @@ class FormTestForm {
* @todo Remove _form_test_tableselect_multiple_true_form().
*/
public function testTableSelectCheckboxes() {
- return drupal_get_form('_form_test_tableselect_multiple_true_form');
+ return \Drupal::formBuilder()->getForm('_form_test_tableselect_multiple_true_form');
}
/**
@@ -81,7 +81,7 @@ class FormTestForm {
* @todo Remove _form_test_tableselect_multiple_false_form().
*/
public function testTableSelectRadios() {
- return drupal_get_form('_form_test_tableselect_multiple_false_form');
+ return \Drupal::formBuilder()->getForm('_form_test_tableselect_multiple_false_form');
}
/**
@@ -90,7 +90,7 @@ class FormTestForm {
* @todo Remove _form_test_tableselect_colspan_form().
*/
public function testTableSelectColspan() {
- return drupal_get_form('_form_test_tableselect_colspan_form');
+ return \Drupal::formBuilder()->getForm('_form_test_tableselect_colspan_form');
}
/**
@@ -99,7 +99,7 @@ class FormTestForm {
* @todo Remove _form_test_tableselect_empty_form().
*/
public function testTableSelectEmptyText() {
- return drupal_get_form('_form_test_tableselect_empty_form');
+ return \Drupal::formBuilder()->getForm('_form_test_tableselect_empty_form');
}
/**
@@ -108,7 +108,7 @@ class FormTestForm {
* @todo Remove _form_test_tableselect_js_select_form().
*/
public function testTableSelectJS($test_action) {
- return drupal_get_form('_form_test_tableselect_js_select_form', $test_action);
+ return \Drupal::formBuilder()->getForm('_form_test_tableselect_js_select_form', $test_action);
}
/**
@@ -117,7 +117,7 @@ class FormTestForm {
* @todo Remove _form_test_vertical_tabs_form().
*/
public function testVerticalTabs() {
- return drupal_get_form('_form_test_vertical_tabs_form');
+ return \Drupal::formBuilder()->getForm('_form_test_vertical_tabs_form');
}
/**
@@ -126,7 +126,7 @@ class FormTestForm {
* @todo Remove form_test_storage_form().
*/
public function testStorage() {
- return drupal_get_form('form_test_storage_form');
+ return \Drupal::formBuilder()->getForm('form_test_storage_form');
}
/**
@@ -135,7 +135,7 @@ class FormTestForm {
* @todo Remove form_test_form_state_values_clean_form().
*/
public function testFormStateClean() {
- return drupal_get_form('form_test_form_state_values_clean_form');
+ return \Drupal::formBuilder()->getForm('form_test_form_state_values_clean_form');
}
/**
@@ -144,7 +144,7 @@ class FormTestForm {
* @todo Remove form_test_form_state_values_clean_advanced_form().
*/
public function testFormStateCleanAdvanced() {
- return drupal_get_form('form_test_form_state_values_clean_advanced_form');
+ return \Drupal::formBuilder()->getForm('form_test_form_state_values_clean_advanced_form');
}
/**
@@ -153,7 +153,7 @@ class FormTestForm {
* @todo Remove _form_test_checkbox().
*/
public function testCheckbox() {
- return drupal_get_form('_form_test_checkbox');
+ return \Drupal::formBuilder()->getForm('_form_test_checkbox');
}
/**
@@ -162,7 +162,7 @@ class FormTestForm {
* @todo Remove form_test_select().
*/
public function testSelect() {
- return drupal_get_form('form_test_select');
+ return \Drupal::formBuilder()->getForm('form_test_select');
}
/**
@@ -171,7 +171,7 @@ class FormTestForm {
* @todo Remove form_test_empty_select().
*/
public function testEmptySelect() {
- return drupal_get_form('form_test_empty_select');
+ return \Drupal::formBuilder()->getForm('form_test_empty_select');
}
/**
@@ -180,7 +180,7 @@ class FormTestForm {
* @todo Remove form_test_language_select().
*/
public function testLanguageSelect() {
- return drupal_get_form('form_test_language_select');
+ return \Drupal::formBuilder()->getForm('form_test_language_select');
}
/**
@@ -189,7 +189,7 @@ class FormTestForm {
* @todo Remove form_test_placeholder_test().
*/
public function testPlaceholder() {
- return drupal_get_form('form_test_placeholder_test');
+ return \Drupal::formBuilder()->getForm('form_test_placeholder_test');
}
/**
@@ -198,7 +198,7 @@ class FormTestForm {
* @todo Remove form_test_number().
*/
public function testNumber() {
- return drupal_get_form('form_test_number');
+ return \Drupal::formBuilder()->getForm('form_test_number');
}
/**
@@ -207,7 +207,7 @@ class FormTestForm {
* @todo Remove form_test_number().
*/
public function testNumberRange() {
- return drupal_get_form('form_test_number', 'range');
+ return \Drupal::formBuilder()->getForm('form_test_number', 'range');
}
/**
@@ -216,7 +216,7 @@ class FormTestForm {
* @todo Remove form_test_range().
*/
public function testRange() {
- return drupal_get_form('form_test_range');
+ return \Drupal::formBuilder()->getForm('form_test_range');
}
/**
@@ -225,7 +225,7 @@ class FormTestForm {
* @todo Remove form_test_range_invalid().
*/
public function testRangeInvalid() {
- return drupal_get_form('form_test_range_invalid');
+ return \Drupal::formBuilder()->getForm('form_test_range_invalid');
}
/**
@@ -234,7 +234,7 @@ class FormTestForm {
* @todo Remove form_test_color().
*/
public function testColor() {
- return drupal_get_form('form_test_color');
+ return \Drupal::formBuilder()->getForm('form_test_color');
}
/**
@@ -243,7 +243,7 @@ class FormTestForm {
* @todo Remove form_test_checkboxes_radios().
*/
public function testCheckboxesRadios($customize) {
- return drupal_get_form('form_test_checkboxes_radios', $customize);
+ return \Drupal::formBuilder()->getForm('form_test_checkboxes_radios', $customize);
}
/**
@@ -252,7 +252,7 @@ class FormTestForm {
* @todo Remove form_test_email().
*/
public function testEmail() {
- return drupal_get_form('form_test_email');
+ return \Drupal::formBuilder()->getForm('form_test_email');
}
/**
@@ -261,7 +261,7 @@ class FormTestForm {
* @todo Remove form_test_url().
*/
public function testUrl() {
- return drupal_get_form('form_test_url');
+ return \Drupal::formBuilder()->getForm('form_test_url');
}
/**
@@ -270,7 +270,7 @@ class FormTestForm {
* @todo Remove _form_test_disabled_elements().
*/
public function testDisabledElements() {
- return drupal_get_form('_form_test_disabled_elements');
+ return \Drupal::formBuilder()->getForm('_form_test_disabled_elements');
}
/**
@@ -279,7 +279,7 @@ class FormTestForm {
* @todo Remove _form_test_input_forgery().
*/
public function testInputForgery() {
- return drupal_get_form('_form_test_input_forgery');
+ return \Drupal::formBuilder()->getForm('_form_test_input_forgery');
}
/**
@@ -288,7 +288,7 @@ class FormTestForm {
* @todo Remove form_test_form_rebuild_preserve_values_form().
*/
public function testRebuildPreservation() {
- return drupal_get_form('form_test_form_rebuild_preserve_values_form');
+ return \Drupal::formBuilder()->getForm('form_test_form_rebuild_preserve_values_form');
}
/**
@@ -297,7 +297,7 @@ class FormTestForm {
* @todo Remove form_test_redirect().
*/
public function testRedirect() {
- return drupal_get_form('form_test_redirect');
+ return \Drupal::formBuilder()->getForm('form_test_redirect');
}
/**
@@ -306,7 +306,7 @@ class FormTestForm {
* @todo Remove form_label_test_form().
*/
public function testLabel() {
- return drupal_get_form('form_label_test_form');
+ return \Drupal::formBuilder()->getForm('form_label_test_form');
}
/**
@@ -315,7 +315,7 @@ class FormTestForm {
* @todo Remove form_test_state_persist().
*/
public function testStatePersistence() {
- return drupal_get_form('form_test_state_persist');
+ return \Drupal::formBuilder()->getForm('form_test_state_persist');
}
/**
@@ -324,7 +324,7 @@ class FormTestForm {
* @todo Remove form_test_clicked_button().
*/
public function testClickedButton($first, $second, $third) {
- return drupal_get_form('form_test_clicked_button', $first, $second, $third);
+ return \Drupal::formBuilder()->getForm('form_test_clicked_button', $first, $second, $third);
}
/**
@@ -333,7 +333,7 @@ class FormTestForm {
* @todo Remove form_test_checkboxes_zero().
*/
public function testCheckboxesZero($json) {
- return drupal_get_form('form_test_checkboxes_zero', $json);
+ return \Drupal::formBuilder()->getForm('form_test_checkboxes_zero', $json);
}
/**
@@ -342,7 +342,7 @@ class FormTestForm {
* @todo Remove form_test_required_attribute().
*/
public function testRequired() {
- return drupal_get_form('form_test_required_attribute');
+ return \Drupal::formBuilder()->getForm('form_test_required_attribute');
}
/**
@@ -351,7 +351,7 @@ class FormTestForm {
* @todo Remove form_test_button_class().
*/
public function testButtonClass() {
- return drupal_get_form('form_test_button_class');
+ return \Drupal::formBuilder()->getForm('form_test_button_class');
}
/**
@@ -360,7 +360,7 @@ class FormTestForm {
* @todo Remove form_test_group_details().
*/
public function testGroupDetails() {
- return drupal_get_form('form_test_group_details');
+ return \Drupal::formBuilder()->getForm('form_test_group_details');
}
/**
@@ -369,7 +369,7 @@ class FormTestForm {
* @todo Remove form_test_group_container().
*/
public function testGroupContainer() {
- return drupal_get_form('form_test_group_container');
+ return \Drupal::formBuilder()->getForm('form_test_group_container');
}
/**
@@ -378,7 +378,7 @@ class FormTestForm {
* @todo Remove form_test_group_fieldset().
*/
public function testGroupFieldset() {
- return drupal_get_form('form_test_group_fieldset');
+ return \Drupal::formBuilder()->getForm('form_test_group_fieldset');
}
/**
@@ -387,7 +387,7 @@ class FormTestForm {
* @todo Remove form_test_group_vertical_tabs().
*/
public function testGroupVerticalTabs() {
- return drupal_get_form('form_test_group_vertical_tabs');
+ return \Drupal::formBuilder()->getForm('form_test_group_vertical_tabs');
}
/**
@@ -396,7 +396,7 @@ class FormTestForm {
* @todo Remove form_test_form_state_database().
*/
public function testFormStateDatabase() {
- return drupal_get_form('form_test_form_state_database');
+ return \Drupal::formBuilder()->getForm('form_test_form_state_database');
}
}
diff --git a/core/modules/update/lib/Drupal/update/Form/UpdateForm.php b/core/modules/update/lib/Drupal/update/Form/UpdateForm.php
index b9046339f4f..8f416c1cdcd 100644
--- a/core/modules/update/lib/Drupal/update/Form/UpdateForm.php
+++ b/core/modules/update/lib/Drupal/update/Form/UpdateForm.php
@@ -18,7 +18,7 @@ class UpdateForm {
*/
public function reportInstall() {
module_load_include('manager.inc', 'update');
- return drupal_get_form('update_manager_install_form', 'report');
+ return \Drupal::formBuilder()->getForm('update_manager_install_form', 'report');
}
/**
@@ -28,7 +28,7 @@ class UpdateForm {
*/
public function reportUpdate() {
module_load_include('manager.inc', 'update');
- return drupal_get_form('update_manager_update_form', 'report');
+ return \Drupal::formBuilder()->getForm('update_manager_update_form', 'report');
}
/**
@@ -38,7 +38,7 @@ class UpdateForm {
*/
public function moduleInstall() {
module_load_include('manager.inc', 'update');
- return drupal_get_form('update_manager_install_form', 'module');
+ return \Drupal::formBuilder()->getForm('update_manager_install_form', 'module');
}
/**
@@ -48,7 +48,7 @@ class UpdateForm {
*/
public function moduleUpdate() {
module_load_include('manager.inc', 'update');
- return drupal_get_form('update_manager_update_form', 'module');
+ return \Drupal::formBuilder()->getForm('update_manager_update_form', 'module');
}
/**
@@ -58,7 +58,7 @@ class UpdateForm {
*/
public function themeInstall() {
module_load_include('manager.inc', 'update');
- return drupal_get_form('update_manager_install_form', 'theme');
+ return \Drupal::formBuilder()->getForm('update_manager_install_form', 'theme');
}
/**
@@ -68,7 +68,7 @@ class UpdateForm {
*/
public function themeUpdate() {
module_load_include('manager.inc', 'update');
- return drupal_get_form('update_manager_update_form', 'theme');
+ return \Drupal::formBuilder()->getForm('update_manager_update_form', 'theme');
}
/**
@@ -78,7 +78,7 @@ class UpdateForm {
*/
public function confirmUpdates() {
module_load_include('manager.inc', 'update');
- return drupal_get_form('update_manager_update_ready_form');
+ return \Drupal::formBuilder()->getForm('update_manager_update_ready_form');
}
}
diff --git a/core/modules/user/lib/Drupal/user/Form/UserForm.php b/core/modules/user/lib/Drupal/user/Form/UserForm.php
index 49c8c766661..919cb1eae67 100644
--- a/core/modules/user/lib/Drupal/user/Form/UserForm.php
+++ b/core/modules/user/lib/Drupal/user/Form/UserForm.php
@@ -18,7 +18,7 @@ class UserForm {
*/
public function resetPass($uid, $timestamp, $hash, $operation) {
module_load_include('pages.inc', 'user');
- return drupal_get_form('user_pass_reset', $uid, $timestamp, $hash, $operation);
+ return \Drupal::formBuilder()->getForm('user_pass_reset', $uid, $timestamp, $hash, $operation);
}
}
diff --git a/core/modules/user/lib/Drupal/user/Plugin/Block/UserLoginBlock.php b/core/modules/user/lib/Drupal/user/Plugin/Block/UserLoginBlock.php
index c087889a96a..b2cff4c2a9a 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/Block/UserLoginBlock.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/Block/UserLoginBlock.php
@@ -32,7 +32,7 @@ class UserLoginBlock extends BlockBase {
* {@inheritdoc}
*/
public function build() {
- $form = drupal_get_form('Drupal\user\Form\UserLoginForm');
+ $form = \Drupal::formBuilder()->getForm('Drupal\user\Form\UserLoginForm');
unset($form['name']['#attributes']['autofocus']);
unset($form['name']['#description']);
unset($form['pass']['#description']);