Hi,
I tried to extend the functionality of 'Users' by adding additional API functions through extending the existing Controllers in Core (\Espo\Controllers\User).
But, it always throw error 404 Not found, since it cannot detect that the module has the extension controller.
I dig deep and found out that it checks the 'scope.User.module' under the Metadata if this action is existing on the controller.
Specifically on this line,
It returns false.
It always check the \Espo\Controllers\User Controller but not my \Espo\Modules\ModuleName\User Controller.
Since it checks the metadata, I added the User.json in scope under metadata of my module with below line.
Then it goes off with an error bad response, and it shows this error log.
Not sure if it is a bug that I cannot extend the User Controller from Core to my own Extension User Controller.
Note: It works fine if I apply the functions in Custom and Core but not when I try it modular.
I tried to extend the functionality of 'Users' by adding additional API functions through extending the existing Controllers in Core (\Espo\Controllers\User).
But, it always throw error 404 Not found, since it cannot detect that the module has the extension controller.
I dig deep and found out that it checks the 'scope.User.module' under the Metadata if this action is existing on the controller.
Specifically on this line,
It returns false.
It always check the \Espo\Controllers\User Controller but not my \Espo\Modules\ModuleName\User Controller.
Since it checks the metadata, I added the User.json in scope under metadata of my module with below line.
Code:
{ "module": "ModuleName" }
Then it goes off with an error bad response, and it shows this error log.
Espo.ERROR: Uncaught Exception TypeError: "Argument 1 passed to Espo\ORM\DB\Mapper::select() must implement interface Espo\ORM\IEntity, null given, called in ../application/Espo/ORM/Repositories/RDB.php on line 187" at ../application/Espo/ORM/DB/Mapper.php line 103 {"exception":"[object] (TypeError(code: 0): Argument 1 passed to Espo\\ORM\\DB\\Mapper::select() must implement interface Espo\\ORM\\IEntity, null given, called in .../application/Espo/ORM/Repositories/RDB.php on line 187 at .../application/Espo/ORM/DB/Mapper.php:103)"} []
Not sure if it is a bug that I cannot extend the User Controller from Core to my own Extension User Controller.
Note: It works fine if I apply the functions in Custom and Core but not when I try it modular.
Comment