Developed built extension doesn't show in prod

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rehida1750
    Junior Member
    • Mar 2025
    • 4

    Developed built extension doesn't show in prod

    I have built an extension that adds 2 bool filters to leads using the ext-template. It works fine in the dev env. When I build it `npm run extension` and upload the zip to prod, the extension is correctly uploaded and installed, and I can see on the prod server the files are there. However, the filters do not show on the prod site at all (they show on the dev site though).

    Cleared cache and even restarted PHP. Also ran the rebuild command. Logs are empty. What else should I try?
  • rehida1750
    Junior Member
    • Mar 2025
    • 4

    #2
    Here's what I've noted so far:

    The AfterInstall script does run when the extension is installed,
    PHP Code:
    $this->container->get('dataManager')->clearCache(); 
    because we can see the cache being cleared and updated. In the metadata.php and objMetadata.php, the boolFilterClassNameMap is correctly added:
    PHP Code:
    'ReceivedEmailFrom' => 'Espo\\Modules\\CustomCRMExtension\\Select\\Lead\\BoolFilters\\ReceivedEmailFrom',
    'NotReceivedEmailFrom' => 'Espo\\Modules\\CustomCRMExtension\\Select\\Lead\\BoolFilters\\NotReceivedEmailFrom'
    .

    What seems NOT to be in the cache though, is the `boolFilterList` - I think it should have added entries like
    PHP Code:
    => ['name' => 'ReceivedEmailFrom'], 
    , but it does not. It does seem to be added in the DEV env though. Manually adding those entries in prod (just for testing) doesn't seem to do anything either.

    Still investigating. Any pointers would be very helpful. Anyone face this before?
    Last edited by rehida1750; 03-07-2025, 10:59 AM. Reason: Desc

    Comment

    • rehida1750
      Junior Member
      • Mar 2025
      • 4

      #3
      Okay, I think I've found a bug:

      When I have code in custom/Espo/Custom, and a module in custom/Espo/Modules/{modulename} - it seems that the former overrides the latter. When I removed the former, the latter was correctly shown and added to the boolFilterList and works as expected now...

      Comment

      • rehida1750
        Junior Member
        • Mar 2025
        • 4

        #4
        Is it expected that you can't mix Custom code and extensions?

        Comment

        • yuri
          Member
          • Mar 2014
          • 8695

          #5
          > I think I've found a bug

          No bug here. Sigh...



          Metadata is merged. custom/Espo/Custom/Resources/metadata/ is applied the last.
          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

          Working...