Commit f2955eb5 authored by larowlan's avatar larowlan

Issue #3062281 by rpsu, acbramley, xjm, catch, Berdir: Deprecate and remove...

Issue #3062281 by rpsu, acbramley, xjm, catch, Berdir: Deprecate and remove block_place module in Drupal 9
parent 312ce8ec
name: Place Blocks
type: module
description: 'Allow administrators to place blocks from any Drupal page'
description: 'Allow administrators to place blocks from any Drupal page. This module is deprecated in Drupal 8.8.0 and will be removed in Drupal 9.0.0. Using Layout Builder (available in Drupal 8.7.0) module is recommended. See https://www.drupal.org/node/3081957. Alternatively you may use the contrib module Place Blocks.'
package: Core (Experimental)
version: VERSION
core: 8.x
......
<?php
/**
* @file
* Contains install and update functions for Place Blocks.
*/
/**
* Implements hook_requirements().
*/
function block_place_requirements($phase) {
$requirements = [];
// Notify about the module being deprecated.
if ($phase == 'runtime') {
$requirements['block_place'] = [
'title' => t('Place blocks'),
'severity' => REQUIREMENT_INFO,
'description' => t('Place Blocks (Core, Experimental) is deprecated in Drupal 8.8.0 and will be removed in Drupal 9.0.0. Using Layout Builder (available in Drupal 8.7.0) module is recommended. See <a href=":change-record">the change record</a>. Alternatively you may use the contrib module <a href=":contrib-link">Place Blocks</a>.', [
':change-record' => 'https://www.drupal.org/node/3081957',
':contrib-link' => 'https://www.drupal.org/project/block_place',
]),
];
}
return $requirements;
}
/**
* Implements hook_install().
*/
function block_place_install() {
\Drupal::messenger()->addWarning(t('Place Blocks (Core, Experimental) is deprecated in Drupal 8.8.0 and will be removed in Drupal 9.0.0. Using Layout Builder (available in Drupal 8.7.0) module is recommended. See <a href=":change-record">the change record</a>. Alternatively you may use the contrib module <a href=":contrib-link">Place Block</a>.', [
':change-record' => 'https://www.drupal.org/node/3081957',
':contrib-link' => 'https://www.drupal.org/project/block_place',
]));
}
......@@ -3,9 +3,11 @@ drupal.block_place:
css:
theme:
css/block-place.css: {}
deprecated: The "%library_id%" asset is deprecated in drupal:8.8.0 and will be removed in drupal:9.0.0. Using Layout Builder (available in drupal:8.7.0) module is recommended. See https://www.drupal.org/node/3081957. Alternatively you may use the contrib module Place Blocks.
drupal.block_place.icons:
version: VERSION
css:
theme:
css/block-place.icons.theme.css: {}
deprecated: The "%library_id%" asset is deprecated in drupal:8.8.0 and will be removed in drupal:9.0.0. Using Layout Builder (available in drupal:8.7.0) module is recommended. See https://www.drupal.org/node/3081957. Alternatively you may use the contrib module Place Blocks.
......@@ -3,8 +3,19 @@
/**
* @file
* Controls the placement of blocks from all pages.
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0.
* See each function in the file for individual deprecation notices with
* upgrade instructions.
*
* @see https://www.drupal.org/node/3081957
*/
@trigger_error('The Place Blocks module is deprecated in drupal:8.8.0 and is removed
from drupal:9.0.0. Using Layout Builder (available in Drupal 8.7.0) module is
recommended. See https://www.drupal.org/node/3081957. Alternatively you may use
the contrib module Place Blocks.', E_USER_DEPRECATED);
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
......@@ -15,6 +26,10 @@ function block_place_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.block_place':
$output = '<h3>' . t('About') . '</h3>';
$output .= '<p><strong>' . t('Place Blocks (Core, Experimental) is deprecated in Drupal 8.8.0 and will be removed in Drupal 9.0.0. Using Layout Builder (available in Drupal 8.7.0) module is recommended. See <a href=":change-record">the change record</a>. Alternatively you may use the contrib module <a href=":contrib-link">Place Blocks</a>.', [
':change-record' => 'https://www.drupal.org/node/3081957',
':contrib-link' => 'https://www.drupal.org/project/block_place',
]) . '</strong></p>';
$output .= '<p>' . t('The Place Blocks module allows you to place blocks from every page. For more information, see the <a href=":blocks-documentation">online documentation for the Place Blocks module</a>.', [':blocks-documentation' => 'https://www.drupal.org/documentation/modules/block_place/']) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<p>' . t('Block placement is specific to each theme on your site. This module allows you to place blocks in the context of your content pages.') . '</p>';
......
......@@ -4,3 +4,4 @@ services:
arguments: ['@request_stack', '@current_user']
tags:
- { name: event_subscriber }
deprecated: The "%service_id%" service is deprecated in drupal:8.8.0 and will be removed in drupal:9.0.0. Using Layout Builder (available in drupal:8.7.0) module is recommended. See https://www.drupal.org/node/3081957. Alternatively you may use the contrib module Place Blocks.
......@@ -2,6 +2,12 @@
namespace Drupal\block_place\EventSubscriber;
@trigger_error('The ' . __NAMESPACE__ . '\BlockPlaceEventSubscriber is
deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Using Layout
Builder (available in Drupal 8.7.0) module is recommended. See
https://www.drupal.org/node/3081957. Alternatively you may use the
contrib module Place Blocks.', E_USER_DEPRECATED);
use Drupal\Core\Render\PageDisplayVariantSelectionEvent;
use Drupal\Core\Render\RenderEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
......@@ -10,6 +16,12 @@
/**
* @see \Drupal\block_place\Plugin\DisplayVariant\PlaceBlockPageVariant
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0.
* Using Layout Builder (available in Drupal 8.7.0) module is recommended.
* Alternatively you may use the contrib module Place Blocks.
*
* @see https://www.drupal.org/node/3081957
*/
class BlockPlaceEventSubscriber implements EventSubscriberInterface {
......@@ -36,6 +48,13 @@ class BlockPlaceEventSubscriber implements EventSubscriberInterface {
* The current user.
*/
public function __construct(RequestStack $request_stack, AccountInterface $account) {
@trigger_error('The ' . __NAMESPACE__ . '\BlockPlaceEventSubscriber is
deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Using
Layout Builder (available in Drupal 8.7.0) module is recommended.
See https://www.drupal.org/node/3081957. Alternatively you may use the
contrib module Place Blocks.', E_USER_DEPRECATED);
$this->requestStack = $request_stack;
$this->account = $account;
}
......
......@@ -2,6 +2,12 @@
namespace Drupal\block_place\Plugin\DisplayVariant;
@trigger_error('The ' . __NAMESPACE__ . '\PlaceBlockPageVariant is
deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Using Layout
Builder (available in Drupal 8.7.0) module is recommended. See
https://www.drupal.org/node/3081957. Alternatively you may use the
contrib module Place Blocks.', E_USER_DEPRECATED);
use Drupal\block\BlockRepositoryInterface;
use Drupal\block\Plugin\DisplayVariant\BlockPageVariant;
use Drupal\Component\Serialization\Json;
......@@ -18,6 +24,12 @@
* id = "block_place_page",
* admin_label = @Translation("Page with blocks and place block buttons")
* )
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0.
* Using Layout Builder (available in Drupal 8.7.0) module is recommended.
* Alternatively you may use the contrib module Place Blocks.
*
* @see https://www.drupal.org/node/3081957
*/
class PlaceBlockPageVariant extends BlockPageVariant {
......@@ -58,6 +70,12 @@ class PlaceBlockPageVariant extends BlockPageVariant {
public function __construct(array $configuration, $plugin_id, $plugin_definition, BlockRepositoryInterface $block_repository, EntityViewBuilderInterface $block_view_builder, array $block_list_cache_tags, ThemeManagerInterface $theme_manager, RedirectDestinationInterface $redirect_destination) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $block_repository, $block_view_builder, $block_list_cache_tags);
@trigger_error('The ' . __NAMESPACE__ . '\PlaceBlockPageVariant is
deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Using
Layout Builder (available in Drupal 8.7.0) module is recommended.
See https://www.drupal.org/node/3081957. Alternatively you may use the
contrib module Place Blocks.', E_USER_DEPRECATED);
$this->themeManager = $theme_manager;
$this->redirectDestination = $redirect_destination;
}
......
......@@ -9,6 +9,7 @@
* Tests the placing a block.
*
* @group block_place
* @group legacy
*/
class BlockPlaceTest extends BrowserTestBase {
......
......@@ -11,6 +11,7 @@
* Tests the field type manager.
*
* @group field
* @group legacy
*/
class FieldTypePluginManagerTest extends FieldKernelTestBase {
......
......@@ -36,6 +36,11 @@ public function testHelpTopics() {
// Enable all modules and themes, so that all routes mentioned in topics
// will be defined.
$module_directories = $this->listDirectories('module');
// @todo Temporary exclusion of a deprecated Place block module.
// @see https://www.drupal.org/project/drupal/issues/3084471
unset($module_directories['block_place']);
\Drupal::service('module_installer')->install(array_keys($module_directories));
$theme_directories = $this->listDirectories('theme');
\Drupal::service('theme_installer')->install(array_keys($theme_directories));
......
......@@ -11,6 +11,7 @@
* Tests that modules exist for all source and destination plugins.
*
* @group migrate_drupal_ui
* @group legacy
*/
class MigrationProvidersExistTest extends MigrateDrupalTestBase {
......
......@@ -21,6 +21,7 @@
* Tests that all migrations are tagged as either content or configuration.
*
* @group migrate_drupal
* @group legacy
*/
class DestinationCategoryTest extends MigrateDrupalTestBase {
......
......@@ -15,6 +15,7 @@
* to determine that all the required files exits.
*
* @group migrate_drupal
* @group legacy
*/
class StateFileExists extends MigrateDrupalTestBase {
......
......@@ -14,6 +14,7 @@
* Tests the migration auditor for ID conflicts.
*
* @group migrate_drupal
* @group legacy
*/
class MigrateDrupal6AuditIdsTest extends MigrateDrupal6TestBase {
......
......@@ -8,6 +8,7 @@
* Tests the getProcess() method of all Drupal 6 migrations.
*
* @group migrate_drupal
* @group legacy
*/
class MigrationProcessTest extends MigrateDrupal6TestBase {
use FileSystemModuleDiscoveryDataProviderTrait;
......
......@@ -8,6 +8,7 @@
* Tests the migration state information in module.migrate_drupal.yml.
*
* @group migrate_drupal
* @group legacy
*/
class ValidateMigrationStateTest extends MigrateDrupal6TestBase {
......
......@@ -14,6 +14,7 @@
* Tests the migration auditor for ID conflicts.
*
* @group migrate_drupal
* @group legacy
*/
class MigrateDrupal7AuditIdsTest extends MigrateDrupal7TestBase {
......
......@@ -8,6 +8,7 @@
* Tests the getProcess() method of all Drupal 7 migrations.
*
* @group migrate_drupal
* @group legacy
*/
class MigrationProcessTest extends MigrateDrupal7TestBase {
use FileSystemModuleDiscoveryDataProviderTrait;
......
......@@ -8,6 +8,7 @@
* Tests the migration state information in module.migrate_drupal.yml.
*
* @group migrate_drupal
* @group legacy
*/
class ValidateMigrationStateTest extends MigrateDrupal7TestBase {
......
......@@ -10,6 +10,7 @@
* Tests that labels exist for all migrations.
*
* @group migrate_drupal_ui
* @group legacy
*/
class MigrationLabelExistTest extends MigrateDrupalTestBase {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment