Commit 9e412258 authored by Jakob P's avatar Jakob P
Browse files

Issue #3300044 by japerry: 3.x Drupal 10 Readiness

parent d9f32285
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -36,9 +36,6 @@
    "issues": "https://www.drupal.org/project/issues/ctools",
    "source": "https://git.drupalcode.org/project/ctools"
  },
  "require": {
    "drupal/core": "^8.8 || ^9"
  },
  "extra": {
    "branch-alias": {
      "dev-8.x-3.x": "3.x-dev"
+1 −1
Original line number Diff line number Diff line
@@ -2,4 +2,4 @@ name: Chaos Tools
type: module
description: 'Provides a number of utility and helper APIs for Drupal developers and site builders.'
package: Chaos tool suite
core_version_requirement: ^8.8 || ^9
core_version_requirement: ^9.3 || ^10
+10 −3
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ use Drupal\Core\Entity\Plugin\Condition\EntityBundle as CoreEntityBundle;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
use Drupal\ctools\Plugin\Condition\EntityBundle;
use Drupal\ctools\Plugin\Condition\EntityBundleConstraint;

/**
 * Implements hook_theme().
@@ -89,16 +90,22 @@ function template_preprocess_ctools_wizard_trail_links(&$variables) {
 * @param $definitions
 */
function ctools_condition_info_alter(&$definitions) {
  // If the node_type's class is unaltered, use a custom ctools implementation.
  // If the node_type's class is unaltered, migrate to entity bundle.
  if (isset($definitions['node_type']) && $definitions['node_type']['class'] == 'Drupal\node\Plugin\Condition\NodeType') {
    $definitions['node_type']['class'] = 'Drupal\ctools\Plugin\Condition\NodeType';
    @trigger_error('\Drupal\node\Plugin\Condition\NodeType is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\Core\Entity\Plugin\Condition\EntityBundle instead. See https://www.drupal.org/node/2983299', E_USER_DEPRECATED);
    $definitions['node_type']['class'] = EntityBundleConstraint::class;
  }

  // Replace all generic entity bundle conditions classes if they are unaltered,
  // these exist in Drupal 9.3+.
  foreach ($definitions as $id => $definition) {
    //@phpstan-ignore-next-line
    if (strpos($id, 'entity_bundle:') === 0 && $definition['class'] == EntityBundle::class) {
      @trigger_error('\Drupal\ctools\Plugin\Condition\EntityBundle is deprecated in ctools:8.x-3.10 and is removed from ctools:4.1.0. Use \Drupal\Core\Entity\Plugin\Condition\EntityBundle instead. See https://www.drupal.org/node/2983299', E_USER_DEPRECATED);
      $definitions[$id]['class'] = EntityBundleConstraint::class;
    }
    if (strpos($id, 'entity_bundle:') === 0 && $definition['class'] == CoreEntityBundle::class) {
      $definitions[$id]['class'] = EntityBundle::class;
      $definitions[$id]['class'] = EntityBundleConstraint::class;
    }
  }

+1 −0
Original line number Diff line number Diff line
@@ -34,5 +34,6 @@ services:
  ctools.serializable.tempstore.factory:
    class: Drupal\ctools\SerializableTempstoreFactory
    arguments: ['@keyvalue.expirable', '@lock', '@request_stack', '%tempstore.expire%', '@current_user']
    deprecated: The "%service_id%" service is deprecated. You should use the core shared tempstore factory service instead.
    tags:
      - { name: backend_overridable }
+1 −1
Original line number Diff line number Diff line
@@ -2,6 +2,6 @@ name: Chaos Tools Blocks
type: module
description: 'Provides improvements to blocks that will one day be added to Drupal core.'
package: Chaos tool suite (Experimental)
core_version_requirement: ^8.8 || ^9
core_version_requirement: ^9.3 || ^10
dependencies:
  - ctools:ctools
Loading