A separate issue was required during development of #2273381: Convert ContextAwarePluginBase to traits due to the out-of-scope changes to testing infrastructure required to be able to perform this deprecation.

Ideally the goal is to deprecate \Drupal\Component\Plugin\ContextAwarePluginBase and \Drupal\Component\Plugin\ContextAwarePluginInterface so that we don't have competing implementations in component and core namespace (background).

Issue fork drupal-3153852

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

clayfreeman created an issue. See original summary.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

catch’s picture

Title: Deprecate context-aware plugin base class and interface in component namespace » Component version of ComponentAwarePluginBase needs deprecation documentation
Status: Postponed » Active

Moving this back to active. I think since we already deprecated the Drupal\Core version and everything around it, we should just add the docs to 9.4 and 9.5 and be done with it.

clayfreeman’s picture

Title: Component version of ComponentAwarePluginBase needs deprecation documentation » Both component and core versions of ContextAwarePluginBase need updated deprecation documentation

Updating issue title to more accurately reflect what's needed.

clayfreeman’s picture

Status: Active » Needs review
catch’s picture

Status: Needs review » Needs work

Real test failure, one of the patches in #2273381: Convert ContextAwarePluginBase to traits (before this hunk was removed) has a fix for it.

catch’s picture

longwave’s picture

Status: Needs work » Reviewed & tested by the community

The MR is passing, so not sure why #11 is needed. The deprecation notices look OK to me.

catch’s picture

@longwave the patch is for this test failure from #8.

https://www.drupal.org/pift-ci-job/2403778

1) Drupal\Tests\Component\DrupalComponentTest::testNoCoreInComponent
Checking for illegal reference to 'Drupal\Core' namespace in /var/www/html/core/lib/Drupal/Component/Plugin/ContextAwarePluginBase.php
Failed asserting that an array is empty.

Not sure why it failed there but passed for the MR.

clayfreeman’s picture

@catch

For clarity: my original commit in the merge request failed with that message, but I amended my commit and did a force push to remove any mention of Drupal\Core in the deprecation notice and instead declared that there was no replacement (because there truly isn't one at the component-level).

The MR is now passing because of this change, so the patch from #11 shouldn't be necessary.

  • catch committed 8d08317 on 10.0.x
    Issue #3153852 by clayfreeman, catch: Both component and core versions...

  • catch committed a7a75a7 on 9.5.x
    Issue #3153852 by clayfreeman, catch: Both component and core versions...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Ohhhhh that explains it!

Committed/pushed to 10.0.x and cherry-picked to 9.5.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.