Skip to content
This repository was archived by the owner on Mar 27, 2018. It is now read-only.
This repository was archived by the owner on Mar 27, 2018. It is now read-only.

Extra guard for adjustformSubmitTrigger #5

@idm

Description

@idm

Yes, I know there's a caveat emptor that says it's a sample and not fit for production use...

I think the guard in adjustFormSubmitTrigger before setting existingTrigger should be conjoined with:

triggers[i].getHandlerFunction() == 'respondToFormSubmit'

If a form has multiple handlers responding to formSubmit then I think it's possible for a formSubmit handler other than the one from notifications-addon to be deleted.

Obviously the extra guard won't help if the handlers have the same name, so they should probably be informally namespaced (for example, 'notificationsRespondToFormSubmit').

The only other way I can see to avoid this problem would be to have each handler script owned by a different user so getUserTriggers only returns one formSubmit trigger.

Let me know if I'm missing or misunderstanding something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions