diff --git a/core/lib/Drupal/Core/Extension/ModuleInstaller.php b/core/lib/Drupal/Core/Extension/ModuleInstaller.php index 1c1d68b823..c3dbcc86ac 100644 --- a/core/lib/Drupal/Core/Extension/ModuleInstaller.php +++ b/core/lib/Drupal/Core/Extension/ModuleInstaller.php @@ -175,13 +175,12 @@ public function install(array $module_list, $enable_dependencies = TRUE) { // Update the module handler in order to load the module's code. // This allows the module to participate in hooks and its existence to - // be discovered by other modules. The module code ("$module.module" and - // "$module.install" files) are loaded only after the kernel rebuild in - // order to make the PSR4 namespaces provided by this module available - // to its own code. + // be discovered by other modules. // The current ModuleHandler instance is obsolete with the kernel // rebuild below. $this->moduleHandler->setModuleList($module_filenames); + $this->moduleHandler->load($module); + module_load_install($module); // Clear the static cache of system_rebuild_module_data() to pick up the // new module, since it merges the installation status of modules into @@ -191,10 +190,6 @@ public function install(array $module_list, $enable_dependencies = TRUE) { // Update the kernel to include it. $this->updateKernel($module_filenames); - // Load the module code ("$module.module" and "$module.install" files). - $this->moduleHandler->load($module); - module_load_install($module); - // Allow modules to react prior to the installation of a module. $this->moduleHandler->invokeAll('module_preinstall', array($module)); diff --git a/core/modules/aggregator/aggregator.module b/core/modules/aggregator/aggregator.module index 5180b758c6..d4adae4edd 100644 --- a/core/modules/aggregator/aggregator.module +++ b/core/modules/aggregator/aggregator.module @@ -6,7 +6,6 @@ */ use Drupal\aggregator\Entity\Feed; -use Drupal\aggregator\FeedStorageInterface; use Drupal\Core\Routing\RouteMatchInterface; /** @@ -15,7 +14,7 @@ * @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. * Use \Drupal\aggregator\FeedStorageInterface::CLEAR_NEVER instead. */ -const AGGREGATOR_CLEAR_NEVER = FeedStorageInterface::CLEAR_NEVER; +const AGGREGATOR_CLEAR_NEVER = 0; /** * Implements hook_help(). diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 1719f2f6d6..33af00ae88 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -32,7 +32,7 @@ * @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. * Use \Drupal\comment\CommentInterface::ANONYMOUS_MAYNOT_CONTACT instead. */ -const COMMENT_ANONYMOUS_MAYNOT_CONTACT = CommentInterface::ANONYMOUS_MAYNOT_CONTACT; +const COMMENT_ANONYMOUS_MAYNOT_CONTACT = 0; /** * Anonymous posters may leave their contact information. @@ -40,7 +40,7 @@ * @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. * Use \Drupal\comment\CommentInterface::ANONYMOUS_MAY_CONTACT instead. */ -const COMMENT_ANONYMOUS_MAY_CONTACT = CommentInterface::ANONYMOUS_MAY_CONTACT; +const COMMENT_ANONYMOUS_MAY_CONTACT = 1; /** * Anonymous posters are required to leave their contact information. @@ -48,7 +48,7 @@ * @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. * Use \Drupal\comment\CommentInterface::ANONYMOUS_MUST_CONTACT instead. */ -const COMMENT_ANONYMOUS_MUST_CONTACT = CommentInterface::ANONYMOUS_MUST_CONTACT; +const COMMENT_ANONYMOUS_MUST_CONTACT = 2; /** * The time cutoff for comments marked as read for entity types other node. diff --git a/core/modules/menu_ui/menu_ui.module b/core/modules/menu_ui/menu_ui.module index 79cdcabdb5..bbd8669e29 100644 --- a/core/modules/menu_ui/menu_ui.module +++ b/core/modules/menu_ui/menu_ui.module @@ -17,7 +17,6 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\menu_link_content\Entity\MenuLinkContent; -use Drupal\Core\Menu\MenuLinkManagerInterface; use Drupal\node\NodeTypeInterface; use Drupal\system\Entity\Menu; use Drupal\node\NodeInterface; @@ -31,7 +30,7 @@ * Use \Drupal\Core\Menu\MenuLinkManagerInterface::MAX_MENU_NAME_LENGTH_UI * instead. */ -const MENU_MAX_MENU_NAME_LENGTH_UI = MenuLinkManagerInterface::MAX_MENU_NAME_LENGTH_UI; +const MENU_MAX_MENU_NAME_LENGTH_UI = 27; /** * Implements hook_help(). diff --git a/core/modules/responsive_image/responsive_image.module b/core/modules/responsive_image/responsive_image.module index bea657a630..927c6106d9 100644 --- a/core/modules/responsive_image/responsive_image.module +++ b/core/modules/responsive_image/responsive_image.module @@ -11,7 +11,6 @@ use Drupal\Core\Routing\RouteMatchInterface; use Drupal\image\Entity\ImageStyle; use Drupal\responsive_image\Entity\ResponsiveImageStyle; -use Drupal\responsive_image\ResponsiveImageStyleInterface; use Drupal\Core\Image\ImageInterface; use Drupal\breakpoint\BreakpointInterface; @@ -23,8 +22,8 @@ * and \Drupal\responsive_image\ResponsiveImageStyleInterface::ORIGINAL_IMAGE * instead. */ -const RESPONSIVE_IMAGE_EMPTY_IMAGE = ResponsiveImageStyleInterface::EMPTY_IMAGE; -const RESPONSIVE_IMAGE_ORIGINAL_IMAGE = ResponsiveImageStyleInterface::ORIGINAL_IMAGE; +const RESPONSIVE_IMAGE_EMPTY_IMAGE = '_empty image_'; +const RESPONSIVE_IMAGE_ORIGINAL_IMAGE = '_original image_'; /** * Implements hook_help(). diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 01523f0391..473bdfabf4 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -13,7 +13,6 @@ use Drupal\Core\Database\Query\AlterableInterface; use Drupal\Core\Extension\Extension; use Drupal\Core\Extension\ExtensionDiscovery; -use Drupal\Core\Form\FormInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\KeyValueStore\KeyValueDatabaseExpirableFactory; use Drupal\Core\PageCache\RequestPolicyInterface; @@ -59,7 +58,7 @@ * @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. * Use \Drupal\Core\Form\FormInterface::DISABLED instead. */ -const DRUPAL_DISABLED = FormInterface::DISABLED; +const DRUPAL_DISABLED = 0; /** * Optional option on forms and settings. @@ -67,7 +66,7 @@ * @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. * Use \Drupal\Core\Form\FormInterface::OPTIONAL instead. */ -const DRUPAL_OPTIONAL = FormInterface::OPTIONAL; +const DRUPAL_OPTIONAL = 1; /** * Required option on forms and settings. @@ -75,7 +74,7 @@ * @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. * Use \Drupal\Core\Form\FormInterface::REQUIRED instead. */ -const DRUPAL_REQUIRED = FormInterface::REQUIRED; +const DRUPAL_REQUIRED = 2; /** * Return only visible regions. diff --git a/core/modules/update/update.module b/core/modules/update/update.module index 1a5711bf2a..f280e019ca 100644 --- a/core/modules/update/update.module +++ b/core/modules/update/update.module @@ -15,8 +15,6 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Site\Settings; -use Drupal\update\UpdateFetcherInterface; -use Drupal\update\UpdateManagerInterface; /* * These are internally used constants for this code, do not modify. @@ -28,7 +26,7 @@ * @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. * Use \Drupal\update\UpdateManagerInterface::NOT_SECURE instead. */ -const UPDATE_NOT_SECURE = UpdateManagerInterface::NOT_SECURE; +const UPDATE_NOT_SECURE = 1; /** * Current release has been unpublished and is no longer available. @@ -36,7 +34,7 @@ * @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. * Use \Drupal\update\UpdateManagerInterface::REVOKED instead. */ -const UPDATE_REVOKED = UpdateManagerInterface::REVOKED; +const UPDATE_REVOKED = 2; /** * Current release is no longer supported by the project maintainer. @@ -44,7 +42,7 @@ * @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. * Use \Drupal\update\UpdateManagerInterface::NOT_SUPPORTED instead. */ -const UPDATE_NOT_SUPPORTED = UpdateManagerInterface::NOT_SUPPORTED; +const UPDATE_NOT_SUPPORTED = 3; /** * Project has a new release available, but it is not a security release. @@ -52,7 +50,7 @@ * @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. * Use \Drupal\update\UpdateManagerInterface::NOT_CURRENT instead. */ -const UPDATE_NOT_CURRENT = UpdateManagerInterface::NOT_CURRENT; +const UPDATE_NOT_CURRENT = 4; /** * Project is up to date. @@ -60,7 +58,7 @@ * @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. * Use \Drupal\update\UpdateManagerInterface::CURRENT instead. */ -const UPDATE_CURRENT = UpdateManagerInterface::CURRENT; +const UPDATE_CURRENT = 5; /** * Project's status cannot be checked. @@ -68,7 +66,7 @@ * @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. * Use \Drupal\update\UpdateFetcherInterface::NOT_CHECKED instead. */ -const UPDATE_NOT_CHECKED = UpdateFetcherInterface::NOT_CHECKED; +const UPDATE_NOT_CHECKED = -1; /** * No available update data was found for project. @@ -76,7 +74,7 @@ * @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. * Use \Drupal\update\UpdateFetcherInterface::UNKNOWN instead. */ -const UPDATE_UNKNOWN = UpdateFetcherInterface::UNKNOWN; +const UPDATE_UNKNOWN = -2; /** * There was a failure fetching available update data for this project. @@ -84,7 +82,7 @@ * @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. * Use \Drupal\update\UpdateFetcherInterface::NOT_FETCHED instead. */ -const UPDATE_NOT_FETCHED = UpdateFetcherInterface::NOT_FETCHED; +const UPDATE_NOT_FETCHED = -3; /** * We need to (re)fetch available update data for this project. @@ -92,7 +90,7 @@ * @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. * Use \Drupal\update\UpdateFetcherInterface::FETCH_PENDING instead. */ -const UPDATE_FETCH_PENDING = UpdateFetcherInterface::FETCH_PENDING; +const UPDATE_FETCH_PENDING = -4; /** * Implements hook_help(). diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 26f768580e..969ef89c97 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -32,7 +32,7 @@ * @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. * Use \Drupal\user\UserInterface::USERNAME_MAX_LENGTH instead. */ -const USERNAME_MAX_LENGTH = UserInterface::USERNAME_MAX_LENGTH; +const USERNAME_MAX_LENGTH = 60; /** * Only administrators can create user accounts. @@ -40,7 +40,7 @@ * @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. * Use \Drupal\user\UserInterface::REGISTER_ADMINISTRATORS_ONLY instead. */ -const USER_REGISTER_ADMINISTRATORS_ONLY = UserInterface::REGISTER_ADMINISTRATORS_ONLY; +const USER_REGISTER_ADMINISTRATORS_ONLY = 'admin_only'; /** * Visitors can create their own accounts. @@ -48,7 +48,7 @@ * @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. * Use \Drupal\user\UserInterface::REGISTER_VISITORS instead. */ -const USER_REGISTER_VISITORS = UserInterface::REGISTER_VISITORS; +const USER_REGISTER_VISITORS = 'visitors'; /** * Visitors can create accounts, but they don't become active without @@ -58,7 +58,7 @@ * Use \Drupal\user\UserInterface::REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL * instead. */ -const USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL = UserInterface::REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL; +const USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL = 'visitors_admin_approval'; /** * Implements hook_help().