Deprecated class Drupal\ctools\Plugin\Condition\NodeType

Created on 24 November 2023, over 1 year ago
Updated 7 April 2024, 12 months ago

Problem/Motivation

I'm working on a Drupal 9.5 site. I have the Upgrade Status module installed and it reports the following issue with ctools:

 Fetching class constant class of deprecated class Drupal\ctools\Plugin\Condition\NodeType. Deprecated in ctools:8.x-1.10. Will be removed before ctools:4.1.0. Use Drupal\ctools\Plugin\Condition\EntityBundle instead. 

I've updated to 4.0.4 and error remains. I also tried latest dev with no change.

Steps to reproduce

Using composer, install and enable ctools module (https://drupal.org/project/ctools/) and the upgrade status module (https://drupal.org/project/upgrade_status). Run the upgrade status report (/admin/reports/upgrade-status) and note the ctools error (disregard any other errors for this test).

Proposed resolution

I believe the issue is in the `ctools.module` file, which uses the `NodeType::class` so this must be corrected.

🐛 Bug report
Status

Closed: won't fix

Version

4.0

Component

Code

Created by

🇺🇸United States jmev

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jmev
  • Status changed to Needs review over 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 8
    last update over 1 year ago
    Patch Failed to Apply
  • 🇺🇸United States jmev

    Here's a quick patch that seems to solve the deprecation report, but needs testing.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 8
    last update over 1 year ago
    Patch Failed to Apply
  • 🇮🇳India shubhangi1995 GURGAON

    Above patch fails hence contributing same fix with 8.x-3.14 version

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    63 pass
  • 🇮🇳India shubhangi1995 GURGAON

    Update for test with version

  • Status changed to RTBC over 1 year ago
  • 🇦🇷Argentina tguerineau

    Hi,

    I've successfully tested the patch provided in comment #4 on the ctools module version 4.0.4. Here are the details of my testing procedure and findings:

    Environment:

    - Drupal Version: 9.5
    - Module version: 4.0.4

    Patch Application:

    - I downloaded the patch named "3403902-ctools-deprecated_nodetype_code_fix-2.patch" in the #4 comment and applied it to my local Drupal installation using the `patch` command.
    - The patch was applied without any issues.

    Testing Procedure:

    - After applying the patch, I cleared the Drupal cache.
    - I navigated to the Upgrade Status report page and ran the report.
    - The previously reported warning regarding the deprecated `Drupal\ctools\Plugin\Condition\NodeType` class was no longer present.

    Observations:

    - Post-patch, all functionalities of the ctools module appeared to operate normally.
    - No new warnings or errors were observed in the system logs.

    Based on my testing, the patch successfully resolves the issue.

  • Status changed to Closed: won't fix 12 months ago
  • 🇺🇸United States japerry KVUO

    Please look at the code before submitting these patches. You'll see clearly that this is a deprecation to support older versions of Drupal. It will be removed eventually when we drop support for Drupal 9.

Production build 0.71.5 2024