diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 8c947e2..d8fac86 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -221,7 +221,7 @@ function _theme($hook, $variables = array()) { // theme registry to work with, and therefore cannot process the theme // request properly. See also \Drupal\Core\Theme\Registry::get(). if (!$module_handler->isLoaded() && !defined('MAINTENANCE_MODE')) { - throw new Exception(t('_theme() may not be called until all modules are loaded.')); + //throw new Exception(t('_theme() may not be called until all modules are loaded.')); } /** @var \Drupal\Core\Utility\ThemeRegistry $theme_registry */ diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index c014e4a..2f0e43e 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -421,7 +421,7 @@ public function getContainer() { */ public function preHandle(Request $request) { // Load all enabled modules. - $this->container->get('module_handler')->loadAll(); + //$this->container->get('module_handler')->loadAll(); // Initialize legacy request globals. $this->initializeRequestGlobals($request); diff --git a/core/lib/Drupal/Core/Extension/ModuleHandler.php b/core/lib/Drupal/Core/Extension/ModuleHandler.php index 035e75f..1d7e394 100644 --- a/core/lib/Drupal/Core/Extension/ModuleHandler.php +++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php @@ -368,6 +368,7 @@ public function implementsHook($module, $hook) { * {@inheritdoc} */ public function invoke($module, $hook, array $args = array()) { + $this->loadAll(); if (!$this->implementsHook($module, $hook)) { return; } @@ -506,9 +507,11 @@ protected function getImplementationInfo($hook) { $this->verified = array(); if ($cache = $this->cacheBackend->get('module_implements')) { $this->implementations = $cache->data; + $this->loadAll(); } } if (!isset($this->implementations[$hook])) { + $this->loadAll(); // The hook is not cached, so ensure that whether or not it has // implementations, the cache is updated at the end of the request. $this->cacheNeedsWriting = TRUE; @@ -518,6 +521,7 @@ protected function getImplementationInfo($hook) { $this->verified[$hook] = TRUE; } elseif (!isset($this->verified[$hook])) { + $this->loadAll(); if (!$this->verifyImplementations($this->implementations[$hook], $hook)) { // One or more of the implementations did not exist and need to be // removed in the cache. diff --git a/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php b/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php index 43532a0..45cf109 100644 --- a/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php +++ b/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php @@ -279,7 +279,7 @@ public function addStreamWrapper($service_id, $class, $scheme) { * Internal use only. */ public function register() { - $this->moduleHandler->alter('stream_wrappers', $this->info); + //$this->moduleHandler->alter('stream_wrappers', $this->info); foreach ($this->info as $scheme => $info) { $this->registerWrapper($scheme, $info['class'], $info['type']); diff --git a/core/modules/filter/src/FilterFormatListBuilder.php b/core/modules/filter/src/FilterFormatListBuilder.php index 0003cfa..00b1743 100644 --- a/core/modules/filter/src/FilterFormatListBuilder.php +++ b/core/modules/filter/src/FilterFormatListBuilder.php @@ -107,6 +107,8 @@ public function buildRow(EntityInterface $entity) { } else { $row['label'] = $this->getLabel($entity); + \Drupal::moduleHandler()->load('user'); + \Drupal::moduleHandler()->load('filter'); $roles = array_map('\Drupal\Component\Utility\String::checkPlain', filter_get_roles_by_format($entity)); $roles_markup = $roles ? implode(', ', $roles) : $this->t('No roles may use this format'); } diff --git a/core/modules/language/src/DefaultLanguageItem.php b/core/modules/language/src/DefaultLanguageItem.php index 0ef14e2..6438554 100644 --- a/core/modules/language/src/DefaultLanguageItem.php +++ b/core/modules/language/src/DefaultLanguageItem.php @@ -48,6 +48,7 @@ public function applyDefaultValue($notify = TRUE) { * A string language code. */ public function getDefaultLangcode(EntityInterface $entity) { + \Drupal::moduleHandler()->load('language'); return language_get_default_langcode($entity->getEntityTypeId(), $entity->bundle()); } diff --git a/core/modules/node/src/Entity/NodeType.php b/core/modules/node/src/Entity/NodeType.php index 73e1202..97a8051 100644 --- a/core/modules/node/src/Entity/NodeType.php +++ b/core/modules/node/src/Entity/NodeType.php @@ -87,7 +87,7 @@ class NodeType extends ConfigEntityBundleBase implements NodeTypeInterface { * * @var int */ - protected $preview_mode = DRUPAL_OPTIONAL; + protected $preview_mode = 1; /** * Display setting for author and date Submitted by post information. diff --git a/core/modules/simpletest/src/Form/SimpletestTestForm.php b/core/modules/simpletest/src/Form/SimpletestTestForm.php index b55de4c..c168352 100644 --- a/core/modules/simpletest/src/Form/SimpletestTestForm.php +++ b/core/modules/simpletest/src/Form/SimpletestTestForm.php @@ -111,6 +111,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { ); // Generate the list of tests arranged by group. + \Drupal::moduleHandler()->load('simpletest'); $groups = simpletest_test_get_all(); foreach ($groups as $group => $tests) { $form['tests'][$group] = array( diff --git a/core/modules/user/src/Controller/UserController.php b/core/modules/user/src/Controller/UserController.php index be1b03d..1def11e 100644 --- a/core/modules/user/src/Controller/UserController.php +++ b/core/modules/user/src/Controller/UserController.php @@ -167,6 +167,7 @@ public function userTitle(UserInterface $user = NULL) { * A redirection to home page. */ public function logout() { + \Drupal::moduleHandler()->load('user'); user_logout(); return $this->redirect(''); } diff --git a/core/modules/user/src/Form/UserLoginForm.php b/core/modules/user/src/Form/UserLoginForm.php index 4cfdff3..0466adf 100644 --- a/core/modules/user/src/Form/UserLoginForm.php +++ b/core/modules/user/src/Form/UserLoginForm.php @@ -83,7 +83,8 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#type' => 'textfield', '#title' => $this->t('Username'), '#size' => 60, - '#maxlength' => USERNAME_MAX_LENGTH, + //'#maxlength' => USERNAME_MAX_LENGTH, + '#maxlength' => 60, '#description' => $this->t('Enter your @s username.', array('@s' => $this->config('system.site')->get('name'))), '#required' => TRUE, '#attributes' => array(