Verified Commit 93b7946d authored by Lee Rowlands's avatar Lee Rowlands
Browse files

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

(cherry picked from commit f2955eb5)
parent bef49c3a
Loading
Loading
Loading
Loading
+1 −1
Changes for core/modules/block_place/block_place.info.yml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
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
+36 −0
Changes for core/modules/block_place/block_place.install: 36 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?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',
  ]));
}
+2 −0
Changes for core/modules/block_place/block_place.libraries.yml: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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.
+15 −0
Changes for core/modules/block_place/block_place.module: 15 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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>';
+1 −0
Changes for core/modules/block_place/block_place.services.yml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -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.
Loading