-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Fix for #9566: Show the correct label in the admin #11397
Fix for #9566: Show the correct label in the admin #11397
Conversation
* Class ShipmentTest | ||
* @package Magento\Sales\Model\Order | ||
*/ | ||
class StatusTest extends \PHPUnit\Framework\TestCase |
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.
you can have I test + dataPorviderer instead of 2 similar tests
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.
@okorshenko are you happy with this updated test?
Hi @okorshenko, I've updated the test to use a data provider. |
Hi @michielgerritsen thanks for the PR so far it looks good and the status is changed on the main order detail display. What would your thoughts be on also updating the "Notes for this order" section's drop-down also? |
Hi David, Thanks, makes sense. I just updated the PR with changes to use the correct label in that dropdown. |
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.
Thanks for this change. It does look like there is a bit of code duplication here. Could we consider using the same method for both cases?
@@ -211,7 +218,7 @@ public function getStateStatuses($state, $addLabels = true) | |||
foreach ($collection as $item) { | |||
$status = $item->getData('status'); | |||
if ($addLabels) { | |||
$statuses[$status] = $item->getStoreLabel(); | |||
$statuses[$status] = $area == 'adminhtml' ? $item->getLabel() : $item->getStoreLabel(); |
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.
Great looks like this fixes the problem. It does appear that this is the same check as in getStatusLabel
, assuming that $item
here and $status
in the getStatusLabel
are the same type. Is it possible to use the same method for getting the label based on the area?
Makes sense. I just changed the code by calling the |
Thanks @michielgerritsen code looks much cleaner now. Could you take a look at the unit tests that are failing. You should be able to run the failing test cases by running
|
Hi @dmanners, It took some time to find time, but i just updated the code to fix the test. Fingers crossed that Travis will mark it as green :-) |
- Changed typehint to the correct class.
Does @okorshenko maybe have a little bit time to look at this on the last day of #squashtoberfest? |
Description
When creating an order status it is possible to set different labels for the different store views. This label was used in the backend as well, this fix makes sure the general status label is used in the backend.
Fixed Issues
Manual testing scenarios
Contribution checklist