Problem/Motivation
This came up in #3219959: Update standard profile so Olivero is the default theme.
BlockCreationTrait::placeBlock()
places blocks in a sidebar_first
region by default. Not all themes will have such a region, however. In particular, Olivero doesn't. This means that tests using Olivero need to explicitly specify a region when using BlockCreationTrait::placeBlock()
and tests that use multiple themes need to apply some logic to use the correct region depending on the theme or explicitly specify a region that is present in all themes.
Steps to reproduce
Use BlockCreationTrait::placeBlock()
(also known as $this->drupalPlaceBlock()
in functional tests) in a test that sets $defaultTheme = 'olivero';
.
Proposed resolution
Use the content
region instead. Since it doesn't actually matter where things appear in tests only that they appear, this should hopefully cause no disruption. Although it is possible that contrib tests explicitly check that something is within a layout-sidebar-first
class, for example, this is not done anywhere in core, so it's not particularly likely (and also easy to fix if so).
Remaining tasks
User interface changes
-
API changes
-
Data model changes
BlockCreationTrait::placeBlock()
places blocks in the content
region by default instead of sidebar_first
.