diff --git a/core/includes/theme.inc b/core/includes/theme.inc index a692836..5a13735 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -100,7 +100,7 @@ function drupal_theme_initialize() { // @todo Let the theme.negotiator listen to the kernel request event. $request = Drupal::request(); - $theme = Drupal::service('theme.negotiator')->determineActiveTheme($request); + $theme = Drupal::service('theme.negotiator')->determineActiveTheme($request) ?: 'stark'; // Store the identifier for retrieving theme settings with. $theme_key = $theme; diff --git a/core/modules/edit/edit.routing.yml b/core/modules/edit/edit.routing.yml index fcba290..4429299 100644 --- a/core/modules/edit/edit.routing.yml +++ b/core/modules/edit/edit.routing.yml @@ -6,7 +6,6 @@ edit.metadata: _ajax_base_page_theme: 'TRUE' requirements: _permission: 'access in-place editing' - edit.attachments: path: '/edit/attachments' defaults: diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php index bd2d194..1fdb3ba 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php @@ -157,8 +157,8 @@ function testNoShortcutLink() { $this->assertNoRaw('add-shortcut', 'Add to shortcuts link was not shown on a page the user does not have access to.'); // Verify that the testing mechanism works by verifying the shortcut - // link appears on admin/content/node. - $this->drupalGet('admin/content/node'); + // link appears on admin/content. + $this->drupalGet('admin/content'); $this->assertRaw('add-shortcut', 'Add to shortcuts link was shown on a page the user does have access to.'); } } diff --git a/core/modules/system/lib/Drupal/system/Theme/AdminNegotiator.php b/core/modules/system/lib/Drupal/system/Theme/AdminNegotiator.php index ee8a510..2bd4bd5 100644 --- a/core/modules/system/lib/Drupal/system/Theme/AdminNegotiator.php +++ b/core/modules/system/lib/Drupal/system/Theme/AdminNegotiator.php @@ -8,6 +8,7 @@ namespace Drupal\system\Theme; use Drupal\Core\Config\ConfigFactory; +use Drupal\Core\Entity\EntityManager; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Theme\ThemeNegotiatorInterface; use Symfony\Component\HttpFoundation\Request; @@ -32,16 +33,26 @@ class AdminNegotiator implements ThemeNegotiatorInterface { protected $configFactory; /** + * The entity manager. + * + * @var \Drupal\Core\Entity\EntityManager + */ + protected $entityManager; + + /** * Creates a new AdminNegotiator instance. * * @param \Drupal\Core\Session\AccountInterface $user * The current user. * @param \Drupal\Core\Config\ConfigFactory $config_factory * The config factory. + * @param \Drupal\Core\Entity\EntityManager $entity_manager + * The entity manager. */ - public function __construct(AccountInterface $user, ConfigFactory $config_factory) { + public function __construct(AccountInterface $user, ConfigFactory $config_factory, EntityManager $entity_manager) { $this->user = $user; $this->configFactory = $config_factory; + $this->entityManager = $entity_manager; } /** @@ -49,7 +60,10 @@ public function __construct(AccountInterface $user, ConfigFactory $config_factor */ public function determineActiveTheme(Request $request) { $path = $request->attributes->get('_system_path'); - if ($this->user->hasPermission('view the administration theme') && path_is_admin($path)) { + + // Don't break if the user_role entity is not available in order to decouple + // system and user module. + if ($this->entityManager->hasController('user_role', 'storage') && $this->user->hasPermission('view the administration theme') && path_is_admin($path)) { return $this->configFactory->get('system.theme')->get('admin'); } } diff --git a/core/modules/system/system.services.yml b/core/modules/system/system.services.yml index 784be22..66faf76 100644 --- a/core/modules/system/system.services.yml +++ b/core/modules/system/system.services.yml @@ -31,6 +31,6 @@ services: theme.negotiator.admin_theme: class: Drupal\system\Theme\AdminNegotiator - arguments: ['@current_user', '@config.factory'] + arguments: ['@current_user', '@config.factory', '@entity.manager'] tags: - { name: theme_negotiator, priority: 40 } diff --git a/core/modules/user/user.info.yml b/core/modules/user/user.info.yml index 45a421a..4af3313 100644 --- a/core/modules/user/user.info.yml +++ b/core/modules/user/user.info.yml @@ -6,3 +6,5 @@ version: VERSION core: 8.x required: true configure: user.admin_index +dependencies: + - field diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/FieldCounterTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/FieldCounterTest.php index 8773248..897bfd9 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Handler/FieldCounterTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Handler/FieldCounterTest.php @@ -19,7 +19,7 @@ class FieldCounterTest extends ViewUnitTestBase { * * @var array */ - public static $modules = array('user'); + public static $modules = array('user', 'field'); /** * Views used by this test. @@ -36,6 +36,12 @@ public static function getInfo() { ); } + protected function setUp() { + parent::setUp(); + + $this->installSchema('user', 'users'); + } + function testSimple() { $view = views_get_view('test_view'); $view->setDisplay(); diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/FieldUnitTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/FieldUnitTest.php index eff8929..9c50002 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Handler/FieldUnitTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Handler/FieldUnitTest.php @@ -17,7 +17,7 @@ */ class FieldUnitTest extends ViewUnitTestBase { - public static $modules = array('user'); + public static $modules = array('user', 'field'); /** * Views used by this test. @@ -38,6 +38,12 @@ public static function getInfo() { ); } + protected function setUp() { + parent::setUp(); + + $this->installSchema('user', 'users'); + } + /** * Overrides Drupal\views\Tests\ViewTestBase::viewsData(). */ diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayPageTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayPageTest.php index f420943..0e29538 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayPageTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayPageTest.php @@ -59,6 +59,7 @@ protected function setUp() { // Setup the needed tables in order to make the drupal router working. $this->installSchema('system', array('router', 'menu_router', 'url_alias')); $this->installSchema('menu_link', 'menu_links'); + $this->installSchema('user', 'users'); } /** diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewPageControllerTest.php b/core/modules/views/lib/Drupal/views/Tests/ViewPageControllerTest.php index d4806f0..55767e1 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ViewPageControllerTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/ViewPageControllerTest.php @@ -25,7 +25,7 @@ class ViewPageControllerTest extends ViewUnitTestBase { * * @var array */ - public static $modules = array('user'); + public static $modules = array('user', 'field'); /** * Views used by this test. @@ -55,6 +55,7 @@ public static function getInfo() { protected function setUp() { parent::setUp(); + $this->installSchema('user', 'users'); $this->installSchema('system', array('router', 'menu_router')); $this->pageController = new ViewPageController($this->container->get('entity.manager')->getStorageController('view'), new ViewExecutableFactory());