Skip to content
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

Add Event for sales_order_state_change_before during Order->saveState() #1199

Merged

Conversation

davefreiman
Copy link

Additionally refactored to remove unnecessary protected function
Refactored only call to the protected function to call the public function
Fixed up the docblock as well.

After looking through 6000 Magento 1.x extensions (https://gist.github.com/dfry22/474f727495228baccf28), noticed that the most common model rewrite in all of them (1 in 100 approx.) was Mage_Sales_Model_Order. After analyzing a large sample of these modules, noticed that the most common occurrence was a dispatch of sales_order_status_change.

If this event can be worked into Magento 2, we can remove the need for superfluous plugins looking to intercept the setState() function.

Also refactored the formerly protected _saveState() function, which was only being called once in the class itself, and also had no differences with the public function aside from one default parameter - so combined them into one function, and removed some outdated docblock comments.

Used a transport object in dispatching the event so any modifications in observers are passed back into the function.

David Freiman added 2 commits April 18, 2015 20:02
…->saveState()

Additionally refactored to remove uneccessary protected function
Refactored only call to the protected function to call the public function
Fixed up the docblock as well
@davefreiman davefreiman force-pushed the sales_order_state_change_before branch from 5af4173 to ffda2eb Compare April 19, 2015 19:13
@fooman fooman mentioned this pull request Apr 19, 2015
@vpelipenko vpelipenko self-assigned this Apr 27, 2015
@vpelipenko vpelipenko added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Apr 28, 2015
@vpelipenko
Copy link
Contributor

CR: passed
Builds: green
Resolution: OK to merge
Internal ticket: MAGETWO-36723

vpelipenko added a commit that referenced this pull request Apr 30, 2015
Add Event for sales_order_state_change_before during Order->saveState()
@vpelipenko vpelipenko merged commit 86ee3db into magento:develop Apr 30, 2015
@ilol ilol assigned asemenenko and unassigned vpelipenko Apr 30, 2015
magento-team pushed a commit that referenced this pull request Jun 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: accept
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants