Skip to content

Commit 041ddf6

Browse files
author
Viktor Tymchynskyi
committed
MAGETWO-38417: Table Rates shipping method does not work
1 parent cb66950 commit 041ddf6

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/internal/Magento/Framework/Filesystem/Driver/File.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use Magento\Framework\Exception\FileSystemException;
1111
use Magento\Framework\Filesystem\DriverInterface;
12+
use Magento\Framework\Phrase;
1213

1314
class File implements DriverInterface
1415
{
@@ -639,6 +640,7 @@ public function fileWrite($resource, $data)
639640
* @param array $data
640641
* @param string $delimiter
641642
* @param string $enclosure
643+
* @var $value string|Phrase
642644
* @return int
643645
* @throws FileSystemException
644646
*/
@@ -649,6 +651,7 @@ public function filePutCsv($resource, array $data, $delimiter = ',', $enclosure
649651
* @see https://bugzilla.mozilla.org/show_bug.cgi?id=1054702
650652
*/
651653
foreach ($data as $key => $value) {
654+
$value = (string)$value;
652655
if (isset($value[0]) && $value[0] === '=') {
653656
$data[$key] = ' ' . $value;
654657
}

lib/internal/Magento/Framework/Filesystem/Io/File.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ public function streamWrite($str)
170170
* @param array $row
171171
* @param string $delimiter
172172
* @param string $enclosure
173+
* @var $value string|Phrase
173174
* @return int|false The length of the written string or false
174175
*/
175176
public function streamWriteCsv(array $row, $delimiter = ',', $enclosure = '"')
@@ -182,6 +183,7 @@ public function streamWriteCsv(array $row, $delimiter = ',', $enclosure = '"')
182183
* @see https://bugzilla.mozilla.org/show_bug.cgi?id=1054702
183184
*/
184185
foreach ($row as $key => $value) {
186+
$value = (string)$value;
185187
if (isset($value[0]) && $value[0] === '=') {
186188
$row[$key] = ' ' . $value;
187189
}

0 commit comments

Comments
 (0)