-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
N°1681 - Add new triggers for attachment creation and removal #534
base: support/3.1
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed IRL with Anne-Catherine, several things to change:
Point 1
Hacking the standard "Trigger on update" with JS to remove the "Attachment" class from proposed value doesn't seem like a good option.
Instead we would rather improve the \AttributeClass
class to add a class_exclusion_list
like we do for \AttributeClassAttCodeSet
with attribute_definition_exclusion_list
. Check with @rquetiez or @eespie , they can guide you.
Point 2
The way it is currently done, you can't limit the trigger to attachments of a specific class only, which is most likely something we'll want to do.
Point 3
Because of the previous points, you can't rely on the ComputeValues method and the fact it derived from the standard TriggerOnObjectUpdate, you'll need to call your trigger when attachments are finalized. We might want to add an event for that actually, check with Eric.
May I ask why the existing triggers aren’t sufficient? |
It does but to get an attachment creation notification, we need to create an "on object update" trigger on the attachment with the temp_id field. It's not really logical. |
During the technical review, we'll need to discuss the possible impacts of adding the
|
@@ -3736,7 +3736,7 @@ class AttributeClass extends AttributeString | |||
|
|||
public static function ListExpectedParams() | |||
{ | |||
return array_merge(parent::ListExpectedParams(), array("class_category", "more_values")); | |||
return array_merge(parent::ListExpectedParams(), array('class_category', 'more_values', 'class_exclusion_list')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed during technical review: We'll actually remove it from expected params as it would force any AttributeClass
usage to provide it, which would lead to regression on any module / custos using it.
We'll just add a comment to inform that this option exists.
Create a new trigger "on object's attachment creation"