[Vtigercrm-developers] Event Handler for Users Module

Hamono, Chris (DPC) Chris.Hamono at sa.gov.au
Mon May 4 04:27:16 GMT 2015


I have found out why the users module does not trigger event handlers

The User module calls saveentity() directly instead of calling CRMEntity::Save(‘module’)

This appears to have two effects.


·         Event handlers aren’t called

·         No record is created in the crmentity table as such user objects are not strict crmentity objects

The end result of the second effect is calling eventhandlers on the users ubject fails as there is no setype

There is most probably other side effects which I haven’t explored yet.

In my personal opinion all modules in vtiger should be crmentity objects if only for consistency.

Chris

From: vtigercrm-developers-bounces at lists.vtigercrm.com [mailto:vtigercrm-developers-bounces at lists.vtigercrm.com] On Behalf Of Hamono, Chris (DPC)
Sent: Wednesday, 29 April 2015 10:08 AM
To: vtigercrm-developers at lists.vtigercrm.com
Subject: Re: [Vtigercrm-developers] Event Handler for Users Module

Hi Uma

When installing my module I run the following piece of code…

        $em = new VTEventsManager($adb);
        $em->registerHandler('vtiger.entity.aftersave', MODULEPATH . 'eventhandlers/FOEvent.php', 'FOEvent', "moduleName in ['Accounts','Contacts','Users']");

This event handler  is correctly triggered for both Accounts and Contacts but ignored for User events
This is in vtiger 6.2

Chris

From: vtigercrm-developers-bounces at lists.vtigercrm.com<mailto:vtigercrm-developers-bounces at lists.vtigercrm.com> [mailto:vtigercrm-developers-bounces at lists.vtigercrm.com] On Behalf Of Uma S
Sent: Tuesday, 28 April 2015 10:55 PM
To: vtigercrm-developers at lists.vtigercrm.com<mailto:vtigercrm-developers at lists.vtigercrm.com>
Subject: Re: [Vtigercrm-developers] Event Handler for Users Module

Hi,

Can you please do provide information regarding, how did you added events for user module? What is the intent of this event handler?

On Tue, Apr 28, 2015 at 12:50 PM, Hamono, Chris (DPC) <Chris.Hamono at sa.gov.au<mailto:Chris.Hamono at sa.gov.au>> wrote:

Hi

I have created a module for handling different events

I have no trouble with accounts and contacts but events are not being called for the Users Module

How do I activate events for users module

Chris


_______________________________________________
http://www.vtiger.com/



--
With
Best Regards
Uma.S
Vtiger Team
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20150504/f50c808a/attachment.html>


More information about the vtigercrm-developers mailing list