Commit 4a59fa01 authored by Jakob P's avatar Jakob P Committed by Joël Pittet
Browse files

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

parent d8b60dd5
Loading
Loading
Loading
Loading
+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: ^9.2 || ^10
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;
    }
  }

+6 −0
Original line number Diff line number Diff line
@@ -31,3 +31,9 @@ services:
  ctools.context_mapper:
    class: Drupal\ctools\ContextMapper
    arguments: ['@entity.repository']
  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: ^9.2 || ^10
core_version_requirement: ^9.3 || ^10
dependencies:
  - ctools:ctools
+2 −2
Original line number Diff line number Diff line
@@ -89,8 +89,8 @@ class EntityFieldBlockTest extends BrowserTestBase {
      $url = $this->container->get('file_url_generator')->transformRelative($url);
    }
    else {
      $url = file_create_url($url); // @phpstan-ignore-line
      $url = file_url_transform_relative($url); // @phpstan-ignore-line
      $url = \Drupal::service('file_url_generator')->generateAbsoluteString($url); // @phpstan-ignore-line
      $url = \Drupal::service('file_url_generator')->transformRelative($url); // @phpstan-ignore-line
    }
    $this->assertSession()->responseContains('src="' . $url . '"');
  }
Loading