Class "Espo\Modules\Hello\Controllers\Hello" does not exist

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Serge
    Junior Member
    • Oct 2023
    • 5

    Class "Espo\Modules\Hello\Controllers\Hello" does not exist

    This weekend I have create my first Espo extention using this template: https://github.com/espocrm/ext-template
    It's all working fine; I created a very simple Hello-entity to check I fully understand whats happening.
    After creating the entity with the entity manager, i used the 'copy-custom' function to get all the sources in my src folder.
    But after using the 'node build --copy​', my application doesnt work anymore.
    The files are copied the the right places in the site folder, my 'Hello'module is there in the 'custom\Espo\Modules' folder.

    But i got this error:
    [2023-10-15 20:21:34] ERROR: (-1) Class "Espo\Modules\Hello\Controllers\Hello" does not exist; GET /Settings; line: 174, file: D:\Webserver\ext-template\site\application\Espo\Core\Utils\File\Cla ssMap.php
    [2023-10-15 20:21:34] ERROR: (-1) Class "Espo\Modules\Hello\Controllers\Hello" does not exist; GET /I18n; line: 174, file: D:\Webserver\ext-template\site\application\Espo\Core\Utils\File\Cla ssMap.php​

    Once i remove the Hello-folder from the modules directory, the application directly starts to work again.
    Could you please help me to any direction? I have no cue at all.

    Thanks, Serge.
  • yuri
    Member
    • Mar 2014
    • 8440

    #2
    Hi Serge,

    I didn't try the copy-custom script for a while. Maybe there's some incompatibility with new versions. What is content of the controller class?
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • Serge
      Junior Member
      • Oct 2023
      • 5

      #3
      Just a empty controller:

      Code:
      <?php
      
      namespace Espo\Custom\Controllers;
      
      class Hello extends \Espo\Core\Templates\Controllers\Base
      {
      }
      ​

      Comment


      • rabii
        rabii commented
        Editing a comment
        Did you delete the custom folder after? according to documentation, you should delete the custom folder from Site/custom/Espo/Custom otherwise it will cause issues.

        I think that is what is happening here, i can see that you still have the controller under custom folder which causes the issue.

        Delete the custom folder and try again.

      • Serge
        Serge commented
        Editing a comment
        Many thanks for your reponse; yes i did.
    • yuri
      Member
      • Mar 2014
      • 8440

      #4
      I fixed incompatibility with v8.0.

      Template repository for EspoCRM extensions. Contribute to espocrm/ext-template development by creating an account on GitHub.
      If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

      Comment

      • Serge
        Junior Member
        • Oct 2023
        • 5

        #5
        Thanks yuri, is working now
        Thanks for your fast reply and fix.

        Comment

        Working...