Status label is wrong in admin #9566
Labels
bug report
Fixed in 2.2.x
The issue has been fixed in 2.2 release line
Fixed in 2.3.x
The issue has been fixed in 2.3 release line
Issue: Clear Description
Gate 2 Passed. Manual verification of the issue description passed
Issue: Confirmed
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Issue: Format is valid
Gate 1 Passed. Automatic verification of issue format passed
Issue: Ready for Work
Gate 4. Acknowledged. Issue is added to backlog and ready for development
Reproduced on 2.1.x
The issue has been reproduced on latest 2.1 release
Reproduced on 2.2.x
The issue has been reproduced on latest 2.2 release
Reproduced on 2.3.x
The issue has been reproduced on latest 2.3 release
Preconditions
Steps to reproduce
Expected result
When an order is created in the frontend, order status should have e.g. "erp_uploaded" code.
Label in frontend should be Processing, as we added store specific label "Processing" to "sales_order_status_label" table
But label in admin store should be the original label from "sales_order_status" table, which is not the case.
Actual result
In the file: /vendor/magento/module-sales/Model/Order/Status.php:145, the method "getStoreLabel" is trying to fetch a label for current admin store, but always returns the label for "Default" frontend store (which is id=1 in my case).
The reason is because Magento is not loading ADMIN store id but always returns default store id, even inside adminhtml area:
http://collabshot.com/show/Q8KvAK
"$this->_storeManager->getStore($store);" always returns store id=1 instead of store id=0
This makes status labels usage useless either in the frontend, either in admin, this is how above sample statuses look like in admin:
So, finally, even the source model that is trying to fetch status label is showing Frontend label instead of original admin status label - all because of wrong store id (Default instead of admin) loaded in backend.
Best way to reproduce:
Expected result
Status = "Processing"
Actual result
Status = "Processing on store view"
The text was updated successfully, but these errors were encountered: