File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed
app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer
lib/internal/Magento/Framework Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,9 @@ protected function _getCurrencyCode($row)
102
102
if ($ code = $ this ->getColumn ()->getCurrencyCode ()) {
103
103
return $ code ;
104
104
}
105
- if ($ code = $ row ->getData ($ this ->getColumn ()->getCurrency ())) {
105
+ $ currency = $ this ->getColumn ()->getCurrency ();
106
+
107
+ if ($ currency !== null && $ code = $ row ->getData ($ currency )) {
106
108
return $ code ;
107
109
}
108
110
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ public function render(\Magento\Framework\DataObject $row)
60
60
return $ data ;
61
61
}
62
62
63
- $ data = (float )$ data * $ this ->_getRate ($ row );
63
+ $ data = (float ) $ data * $ this ->_getRate ($ row );
64
64
$ data = sprintf ("%f " , $ data );
65
65
$ data = $ this ->_localeCurrency ->getCurrency ($ currencyCode )->toCurrency ($ data );
66
66
return $ data ;
@@ -79,7 +79,9 @@ protected function _getCurrencyCode($row)
79
79
if ($ code = $ this ->getColumn ()->getCurrencyCode ()) {
80
80
return $ code ;
81
81
}
82
- if ($ code = $ row ->getData ($ this ->getColumn ()->getCurrency ())) {
82
+ $ currency = $ this ->getColumn ()->getCurrency ();
83
+
84
+ if ($ currency !== null && $ code = $ row ->getData ($ currency )) {
83
85
return $ code ;
84
86
}
85
87
return false ;
@@ -94,10 +96,12 @@ protected function _getCurrencyCode($row)
94
96
protected function _getRate ($ row )
95
97
{
96
98
if ($ rate = $ this ->getColumn ()->getRate ()) {
97
- return (float )$ rate ;
99
+ return (float ) $ rate ;
98
100
}
99
- if ($ rate = $ row ->getData ($ this ->getColumn ()->getRateField ())) {
100
- return (float )$ rate ;
101
+ $ rateField = $ this ->getColumn ()->getRateField ();
102
+
103
+ if ($ rateField !== null && $ rate = $ row ->getData ($ rateField )) {
104
+ return (float ) $ rate ;
101
105
}
102
106
return 1 ;
103
107
}
Original file line number Diff line number Diff line change @@ -368,7 +368,8 @@ public function toString($format = '')
368
368
} else {
369
369
preg_match_all ('/\{\{([a-z0-9_]+)\}\}/is ' , $ format , $ matches );
370
370
foreach ($ matches [1 ] as $ var ) {
371
- $ format = str_replace ('{{ ' . $ var . '}} ' , $ this ->getData ($ var ), $ format );
371
+ $ data = $ this ->getData ($ var ) ?? '' ;
372
+ $ format = str_replace ('{{ ' . $ var . '}} ' , $ data , $ format );
372
373
}
373
374
$ result = $ format ;
374
375
}
You can’t perform that action at this time.
0 commit comments