-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
New event "init_form_values_after" after data set on a form #1485
Conversation
Magento does not have a common event after data is set on a form. This new event allows us to change the form, the elements and the values once data is entered, giving full flexibility. I needed this event in a special case where I needed to change the options of a select, to include the current value that was not in the existing options list. There was no other way to do this without overriding many forms 1 by 1.
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.
Excellent addition!
If I was designing from scratch I'd probably add a second event with a default overridable prefix to it like $this->_eventPrefix.'_form_before_html'
so that the eventPrefix can be added to classes making it easier to override the specific form using the event name (same as models). But with or without this should have been added years ago. :)
OT: Is it worth tackling #423 again? You had some conserns here #423 (comment) ... but i'm still not sure how to fix it. |
Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com>
Thanks for the great suggestions @kiatng |
@colinmollenhour and @sreichel can we get this merged? |
Magento does not have a common event after data is set on a form.
This new event allows us to change the form, the elements and the values once data is entered, giving full flexibility.
I needed this event in a special case where I needed to change the options of a select, to include the current value that was not in the existing options list.
There was no other way to do this without overriding many forms 1 by 1.
Contribution checklist (*)