You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exception 'ReflectionException' with message 'Class \Drupal\testmodule\Controller\TestModuleEntityController does not exist' with generate:entity:content and revisions enabled
#2881
Closed
showards opened this issue
Nov 4, 2016
· 4 comments
It looks like when revision capabilities are utilized in generate:entity:content an exception is thrown. I don't know enough to help with it, but the generation code lives in templates/module/src/entity-content-route-provider.php.twig and was introduced in 0dc8f71. The offending Class code is not generated when revisions are disabled. I've attached a rundown of the setup including the exact steps used to generate the error. The error appears at the bottom of the document.
I'm not sure if it's something I'm doing or if it's missing code in the generate:entity:content portion of Drupal Console. :(
EDIT: Note, there are errors in the above text when using drupal console; "commands.yaml.unset.key.yml Unable to parse at line 2 (near " arguments:")." I am pretty sure those will be fixed in 2878, though the version of console used is 1.0.0-rc7
The text was updated successfully, but these errors were encountered:
I think "getControllerPath()" in line 208 in EntityContentGenerator.php... $this->extensionManager->getModule($module)->getControllerPath() .'/'.$entity_class.'Controller.php',
should be "getControllerDirectory()"
which is what is used in ControllerGenerator.php
EDIT: I tested this and the controller now generates but the path needs to be modified in Extensions.php.
Extensions.php... public function getControllerDirectory($fullPath = false) { return $this->getSourcePath($fullPath) . '/Controller/'; }
'/Controller/' should be '/Controller'
but this will probably break ControllerGenerator.php
so maybe a new function should be added and named getEntityControllerPath()
I modded getControllerDirectory() and renamed it to getControllerPath(). Also modded ControllerGenerator.php to use the renamed function. I'll push the changes.
It looks like when revision capabilities are utilized in generate:entity:content an exception is thrown. I don't know enough to help with it, but the generation code lives in templates/module/src/entity-content-route-provider.php.twig and was introduced in 0dc8f71. The offending Class code is not generated when revisions are disabled. I've attached a rundown of the setup including the exact steps used to generate the error. The error appears at the bottom of the document.
I'm not sure if it's something I'm doing or if it's missing code in the generate:entity:content portion of Drupal Console. :(
Drupal Console - New Module Revisions.txt
EDIT: Note, there are errors in the above text when using drupal console; "commands.yaml.unset.key.yml Unable to parse at line 2 (near " arguments:")." I am pretty sure those will be fixed in 2878, though the version of console used is 1.0.0-rc7
The text was updated successfully, but these errors were encountered: