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

Can't save order status label #7006

Closed
robmagento opened this issue Oct 14, 2016 · 11 comments
Closed

Can't save order status label #7006

robmagento opened this issue Oct 14, 2016 · 11 comments
Labels
bug report Component: Sales Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@robmagento
Copy link

Preconditions

  1. Magento 2.1.1 CE
  2. nginx, PHP 7.0.10, MySQL 5.7.11

Steps to reproduce

  1. Admin > Stores > Order Status > click on one from the list > try to add new labels for a certain store view > click save

Expected result

  1. New labels should be stored in db.

Actual result

  1. New label values are not stored in db
@AntonEvers
Copy link
Contributor

The problem is that in \Magento\Sales\Controller\Adminhtml\Order\Status\Save::execute after order status load the order status is missing the label data.

\Magento\Framework\Model\ResourceModel\Db\AbstractDb::save checks if the data that was present on load is changed. It hasn't. But data is added. And that does not count in the isModified check there. So the order status is considered as not modified and the processNotModifiedSave is executed instead of updateObject

@AntonEvers
Copy link
Contributor

@robmagento as a workaround you can edit the main label as well and save it with the store labels. Then edit it back once the labels are in place. This will work.

@AntonEvers
Copy link
Contributor

AntonEvers commented Oct 14, 2016

I'll see if I can make a pull request so that this code will include the store values of the labels.

\Magento\Sales\Controller\Adminhtml\Order\Status\Save::execute

$status = $this->_objectManager->create('Magento\Sales\Model\Order\Status')->load($statusCode);

@robmagento
Copy link
Author

Your workaround... works :). Thank you, I did not have the time to investigate this.

@AntonEvers
Copy link
Contributor

There you go ;)

@SerhiyShkolyarenko
Copy link
Contributor

@robmagento thank you for reporting. Internal issue is MAGETWO-59639

@SerhiyShkolyarenko
Copy link
Contributor

@ajpevers thanks for a workaround!

@SerhiyShkolyarenko SerhiyShkolyarenko added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Oct 17, 2016
@salelsol
Copy link

salelsol commented Jan 4, 2017

@ajpevers same issue, and afther change code works like a charm.

@swayoleg
Copy link

swayoleg commented Sep 7, 2017

On 2.18 it the same

until Magento\Sales\Model\ResourceModel\Order\Status will extend the \Magento\Framework\Model\ResourceModel\Db\AbstractDb
NOT VersionControl
(\Magento\Framework\Model\ResourceModel\Db\VersionControl\AbstractDb)

@swayoleg
Copy link

swayoleg commented Sep 7, 2017

the _afterSave doesnt executed when extention of resource model is from VersionControl

@swayoleg
Copy link

swayoleg commented Sep 7, 2017

This fix still helps
54e50d6

@magento-engcom-team magento-engcom-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Component: Sales labels Sep 7, 2017
magento-devops-reposync-svc pushed a commit that referenced this issue Aug 5, 2021
B2B-1785: Cannot enable remote storage with install command when modules are not enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Sales Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

7 participants