Add support for Drupal Code Generator version 3 (required for drush 12)

Created on 30 May 2023, almost 2 years ago

Problem/Motivation

First RCs of drush 12 have appeared and they require DCG v3. This module requires
DrupalCodeGenerator\Command\Plugin\PluginGenerator to be present so it can't be installed alongside drush 12.

Steps to reproduce

Setup a drupal installation with this module and drush 12 then run a drush command like drush cr to see a fatal error:
Error: Class "DrupalCodeGenerator\Command\Plugin\PluginGenerator" not found

Proposed resolution

Find a way to ignore the v2 service definition (drush.services.yml) and create a new class for v3 support, hopefully autodiscovered just like drush commands.

Remaining tasks

Code a solution

User interface changes

None

API changes

None

Data model changes

None

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain rodrigoaguilera Barcelona

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

Comments & Activities

  • Issue created by @rodrigoaguilera
  • πŸ‡ΊπŸ‡ΈUnited States brad.bulger

    As of 2.3.0 at least, I'm running this module in a Drupal 10 installation with Drush 12.5.2.0, and I am not having any problems using drush. On the other hand, Drush doesn't see this module's generators at all. I started to try to write a new version but didn't get very far.

    Should this issue be closed and a new one opened for the task of upgrading the generator code? Or repurpose this one? It matches the title but not the current description.

  • Status changed to Postponed: needs info about 1 month ago
  • πŸ‡ͺπŸ‡ΈSpain pcambra Asturies

    Could you please confirm if this has been solved in branch 3.x?

  • πŸ‡ͺπŸ‡ΈSpain rodrigoaguilera Barcelona

    I tested with Drupal 11 with Drush 13 and Drupal 10 with Drush 12 both with the 3.x branch and the generators are not detected but the error is gone.
    I think some PHP attributes are needed for recent version of the generators
    https://github.com/Chi-teck/drupal-code-generator/blob/4.x/src/Command/P...

Production build 0.71.5 2024