Skip to content

Commit e3c203a

Browse files
committed
Fixed wrong state title
1 parent 06a0dd0 commit e3c203a

File tree

3 files changed

+3
-54
lines changed

3 files changed

+3
-54
lines changed

app/code/Magento/Sales/Block/Status/Grid/Column/State.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ public function getFrameCallback()
5353
*/
5454
public function decorateState($value, $row, $column, $isExport)
5555
{
56-
$status = $row->getStatus();
57-
if ($value) {
58-
$cell = $value . '[' . $this->_config->getStateLabelByStateAndStatus($value, $status) . ']';
56+
$states = $this->_config->getStates();
57+
if (isset($states[$value])) {
58+
$cell = $value . '[' . $states[$value] . ']';
5959
} else {
6060
$cell = $value;
6161
}

app/code/Magento/Sales/Model/Order/Config.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -300,23 +300,4 @@ protected function _getStatuses($visibility)
300300
}
301301
return $this->statuses[(bool) $visibility];
302302
}
303-
304-
/**
305-
* Retrieve label by state and status
306-
*
307-
* @param string $state
308-
* @param string $status
309-
* @return \Magento\Framework\Phrase|string
310-
* @since 100.2.0
311-
*/
312-
public function getStateLabelByStateAndStatus($state, $status)
313-
{
314-
foreach ($this->_getCollection() as $item) {
315-
if ($item->getData('state') == $state && $item->getData('status') == $status) {
316-
$label = $item->getData('label');
317-
return __($label);
318-
}
319-
}
320-
return $state;
321-
}
322303
}

app/code/Magento/Sales/Test/Unit/Model/Order/ConfigTest.php

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -116,38 +116,6 @@ public function testGetInvisibleOnFrontStatuses()
116116
$this->assertSame($expectedResult, $result);
117117
}
118118

119-
/**
120-
* @return void
121-
*/
122-
public function testGetStateLabelByStateAndStatus()
123-
{
124-
$statuses = [
125-
new DataObject(
126-
[
127-
'status' => 'fraud',
128-
'state' => 'processing',
129-
'label' => 'Suspected Fraud',
130-
]
131-
),
132-
new DataObject(
133-
[
134-
'status' => 'processing',
135-
'state' => 'processing',
136-
'label' => 'Processing',
137-
]
138-
)
139-
];
140-
$collectionMock = $this->createPartialMock(Collection::class, ['create', 'joinStates']);
141-
$this->orderStatusCollectionFactoryMock->expects($this->once())
142-
->method('create')
143-
->will($this->returnValue($collectionMock));
144-
$collectionMock->expects($this->once())
145-
->method('joinStates')
146-
->will($this->returnValue($statuses));
147-
$result = $this->salesConfig->getStateLabelByStateAndStatus('processing', 'fraud');
148-
$this->assertSame('Suspected Fraud', $result->getText());
149-
}
150-
151119
/**
152120
* Test get statuses
153121
*

0 commit comments

Comments
 (0)