Hello,
I try to build a module that use Administration>Integration datas.
1) I've made a new section into Administration>Integration>MyCustomData
2) I made a hook that need to use these datas.
3) I get this error message when the hook is triggered :
[2025-01-20 10:02:44] CRITICAL: (0) Could not load 'integration' service. :: POST /MgWorkspace :: /var/www/html/application/Espo/Core/Container.php(348)
This is a part of my code :
Regarding the new version, would you recommand me to use Secrets instead of Integrations? if yes, should I add new fields to Secrets ? Or should I create 1 record per data I need to use ?
Edit: this post should have been posted into Developper forum section.. sorry
I try to build a module that use Administration>Integration datas.
1) I've made a new section into Administration>Integration>MyCustomData
2) I made a hook that need to use these datas.
3) I get this error message when the hook is triggered :
[2025-01-20 10:02:44] CRITICAL: (0) Could not load 'integration' service. :: POST /MgWorkspace :: /var/www/html/application/Espo/Core/Container.php(348)
This is a part of my code :
Code:
<?php namespace Espo\Modules\CustomAPI\Hooks\MgWorkspace; use Espo\Core\Hooks\Base; class GeoserverSync extends Base { public function beforeSave(\Espo\ORM\Entity $entity, array $options = []) { if ($entity->isNew()) { $geoserverId = $this->createWorkspaceInCustomAPI($entity); $entity->set('CustomAPIId', $CustomAPIId); } else { $this->updateWorkspaceInCustomAPI($entity); } } private function getCustomAPIConfig() { // Récupère le container $container = $this->getContainer(); // Récupère le service "integration" (et non "integrationManager") $integrationManager = $container->get('integration'); // Récupère l'intégration "CustomAPI" $integration = $integrationManager->getIntegration('CustomAPI'); // Renvoie la config return $integration->getConfig(); } }
Regarding the new version, would you recommand me to use Secrets instead of Integrations? if yes, should I add new fields to Secrets ? Or should I create 1 record per data I need to use ?
Edit: this post should have been posted into Developper forum section.. sorry
Comment