Skip to content
This repository has been archived by the owner on Nov 13, 2021. It is now read-only.

Listerners for custom does not apply. #726

Open
sirichoke-kunwed opened this issue Mar 10, 2020 · 0 comments
Open

Listerners for custom does not apply. #726

sirichoke-kunwed opened this issue Mar 10, 2020 · 0 comments

Comments

@sirichoke-kunwed
Copy link

I created folder Listerners in custom/Espo/Custom.
And added class inherits from AbstractListeners, but it does not hook into any actions.

then I add code to parse custom Listeners folder in getClassesName funcion in (vendor/treolabs/treocore/app/Treo/Core/EventManager/Manager.php)

` // for core
$corePath = CORE_PATH . '/Treo/Listeners';
if (file_exists($corePath)) {
$this->parseDir('Treo', $corePath, $listeners);
}

        // for modules
        foreach ($this->container->get('moduleManager')->getModules() as $id => $module) {
            $module->loadListeners($listeners);
        }

        // for custom
        $customPath = 'custom/Espo/Custom/Listeners';
        if (file_exists($customPath)) {
            $this->parseDir('Espo\\Custom', $customPath, $listeners);
        }

`
It works but I'm not sure about the others effect will occur or not.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant