Chi-teck / drupal-code-generator

A code generator for Drupal.
GNU General Public License v2.0
260 stars 46 forks source link

Drupal Entity Generator fails to generate functional entity #117

Closed bhanu951 closed 4 months ago

bhanu951 commented 9 months ago

Description

Drupal Entity Generator fails to generate functional entity with error.

drush cr

In RevisionLogEntityTrait.php line 35:

The entity type test_entity does not have an "revision_user" entity revision metadata key.

Steps to Reproduce

drush gen entity:content

 Welcome to content-entity generator!
––––––––––––––––––––––––––––––––––––––

 Module machine name:
 ➤ test_entity

 Module name [Test entity]:
 ➤

 Entity type label [Test entity]:
 ➤

 Entity type ID [test_entity]:
 ➤

 Entity class [TestEntity]:
 ➤

 Entity base path [/test-entity]:
 ➤

 Make the entity type fieldable? [Yes]:
 ➤ No

 Make the entity type revisionable? [No]:
 ➤ Yes

 Make the entity type translatable? [No]:
 ➤ Yes

 The entity type has bundle? [No]:
 ➤

 Create canonical page? [Yes]:
 ➤

 Create entity template? [Yes]:
 ➤

 Create CRUD permissions? [No]:
 ➤

 Add "label" base field? [Yes]:
 ➤

 Add "status" base field? [Yes]:
 ➤

 Add "created" base field? [Yes]:
 ➤

 Add "changed" base field? [Yes]:
 ➤ No

 Add "author" base field? [Yes]:
 ➤ No

 Add "description" base field? [Yes]:
 ➤ No

 Create REST configuration for the entity? [No]:
 ➤

 The following directories and files have been created or updated:
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
 • /var/www/html/web/modules/custom/test_entity/test_entity.info.yml
 • /var/www/html/web/modules/custom/test_entity/test_entity.links.action.yml
 • /var/www/html/web/modules/custom/test_entity/test_entity.links.contextual.yml
 • /var/www/html/web/modules/custom/test_entity/test_entity.links.menu.yml
 • /var/www/html/web/modules/custom/test_entity/test_entity.links.task.yml
 • /var/www/html/web/modules/custom/test_entity/test_entity.module
 • /var/www/html/web/modules/custom/test_entity/test_entity.permissions.yml
 • /var/www/html/web/modules/custom/test_entity/config/install/system.action.test_entity_delete_action.yml
 • /var/www/html/web/modules/custom/test_entity/src/TestEntityInterface.php
 • /var/www/html/web/modules/custom/test_entity/src/TestEntityListBuilder.php
 • /var/www/html/web/modules/custom/test_entity/src/Entity/TestEntity.php
 • /var/www/html/web/modules/custom/test_entity/src/Form/TestEntityForm.php
 • /var/www/html/web/modules/custom/test_entity/templates/test-entity.html.twig

Actual Behavior

Doesnt generate a working test entity.

Expected Behavior

Should generate a working test entity.

Screenshots

Entity Metadata key missing

Revision meta data array missing revision_user key.

Working definition.

Entity Metadata key present

Version Info

composer show chi-teck/drupal-code-generator
name     : chi-teck/drupal-code-generator
descrip. : Drupal code generator
keywords :
versions : * 3.2.0
type     : library
license  : GNU General Public License v2.0 or later (GPL-2.0-or-later) (OSI approved) https://spdx.org/licenses/GPL-2.0-or-later.html#licenseText
homepage :
source   : [git] https://github.com/Chi-teck/drupal-code-generator.git 6883a423f21446b16f8b9a2d90cc5abd4bc3e5d6
dist     : [zip] https://api.github.com/repos/Chi-teck/drupal-code-generator/zipball/6883a423f21446b16f8b9a2d90cc5abd4bc3e5d6 6883a423f21446b16f8b9a2d90cc5abd4bc3e5d6
path     : /var/www/html/vendor/chi-teck/drupal-code-generator
names    : chi-teck/drupal-code-generator

support
issues : https://github.com/Chi-teck/drupal-code-generator/issues
source : https://github.com/Chi-teck/drupal-code-generator/tree/3.2.0

autoload
psr-4
DrupalCodeGenerator\ => src

requires
ext-json *
php >=8.1.0
psr/event-dispatcher ^1.0
psr/log ^3.0
symfony/console ^6.3
symfony/dependency-injection ^6.3.2
symfony/filesystem ^6.3
symfony/string ^6.3
twig/twig ^3.4

requires (dev)
chi-teck/drupal-coder-extension ^2.0.0-alpha4
drupal/coder 8.3.20
drupal/core 10.1.x-dev
ext-simplexml *
phpspec/prophecy-phpunit ^2.0
phpunit/phpunit ^9.5
squizlabs/php_codesniffer ^3.7
symfony/var-dumper ^6.3
symfony/yaml ^6.3
vimeo/psalm ^5.14.0

conflicts
squizlabs/php_codesniffer <3.6

Drush Version: 12.2.0

Chi-teck commented 9 months ago

I guess it's because BC layer for revision metadata keys has been removed. https://www.drupal.org/node/3099789