Uninstall Issue - (TypeError: Drupal\Core\Plugin\Context\Context::__construct()

Created on 22 March 2023, almost 2 years ago
Updated 13 May 2023, over 1 year ago

Problem/Motivation

I am running into a rules uninstall issue (TypeError: Drupal\Core\Plugin\Context\Context::__construct(): Argument #1 ($context_definition) must be of type Drupal\Core\Plugin\Context\ContextDefinitionInterface, __PHP_Incomplete_Class), that several people seem to have seen - although I note that nobody has been able to replicate this for the purposes of a ticket on the issue queue.

The site is running D10.05, Rules 8.3.x-dev and typed_data 1.x-dev is on php 8.1.

I can also confirm, that a clean install, installation of just rules and typed_data CAN be uninstalled without issue. As such I am simply calling this a support request and asking for any pointers to help resolve - I suspect there is a further interaction in play - this is not so much asking for a 'fix' (as there is probably nothing to fix with rules pre-se).

In the case above, the site has been largely built with all operations and functions working manually via the UI, prior to the install of rules to attempt to create reaction rules for the same manual actions.

No rules were ever built, when I realised that I couldn't create a component to trigger group membership for a user, based on the user receiving a role. The components I created have been removed prior to uninstall.

Notable modules with extensive configuration include groups and profile.

Steps to reproduce

Unable to reproduce with a clean build.

Any assistance gratefully appreciated.

πŸ’¬ Support request
Status

Closed: works as designed

Version

3.0

Component

Rules Core

Created by

πŸ‡¬πŸ‡§United Kingdom martin@manarock.co.uk

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

Comments & Activities

  • Issue created by @martin@manarock.co.uk
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    Rules extends the core context classes such as ContextDefinitionInterface. I suspect that in your cache or service container or class registry, there is still an object that uses the Rules version of one of the context classes. When Rules is removed, any remaining reference to the Rules version of these classes will trigger a __PHP_Incomplete_Class error.

    I don't know where or why this reference still exists - Drupal core should be flushing the caches and rebuilding the container when modules are uninstalled, but perhaps the core process is incomplete and it doesn't clear everything.

    I would certainly try drush cc and drush cr, and also drush php-eval "\Drupal::service('kernel')->rebuildContainer();" to see if you can force Drupal to forget about the Rules classes.

  • Status changed to Postponed: needs info over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia
  • Status changed to Closed: works as designed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    No further information provided.

Production build 0.71.5 2024