File tree Expand file tree Collapse file tree 3 files changed +17
-6
lines changed
app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer
lib/internal/Magento/Framework/View/Element/UiComponent/DataProvider Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,9 @@ protected function _getValue(DataObject $row)
9797 }
9898 return '' ;
9999 }
100- return $ row ->getData ($ this ->getColumn ()->getIndex ());
100+ return $ this ->getColumn ()->getIndex () !== null
101+ ? $ row ->getData ($ this ->getColumn ()->getIndex ())
102+ : null ;
101103 }
102104
103105 /**
Original file line number Diff line number Diff line change @@ -118,11 +118,14 @@ protected function _getCurrencyCode($row)
118118 protected function _getRate ($ row )
119119 {
120120 if ($ rate = $ this ->getColumn ()->getRate ()) {
121- return (float )$ rate ;
121+ return (float ) $ rate ;
122122 }
123- if ($ rate = $ row ->getData ($ this ->getColumn ()->getRateField ())) {
124- return (float )$ rate ;
123+ $ rateField = $ this ->getColumn ()->getRateField ();
124+
125+ if ($ rateField !== null && $ rate = $ row ->getData ($ rateField )) {
126+ return (float ) $ rate ;
125127 }
128+
126129 return $ this ->_defaultBaseCurrency ->getRate ($ this ->_getCurrencyCode ($ row ));
127130 }
128131
Original file line number Diff line number Diff line change 1010use Magento \Framework \Api \AttributeValueFactory ;
1111
1212/**
13- * Class Document
13+ * The document data provider
1414 */
1515class Document extends DataObject implements DocumentInterface
1616{
@@ -33,17 +33,23 @@ public function __construct(AttributeValueFactory $attributeValueFactory)
3333 }
3434
3535 /**
36+ * Gets ID.
37+ *
3638 * @return int|string
3739 */
3840 public function getId ()
3941 {
4042 if (!$ this ->id ) {
41- $ this ->id = $ this ->getData ($ this ->getIdFieldName ());
43+ $ this ->id = $ this ->getIdFieldName () !== null
44+ ? $ this ->getData ($ this ->getIdFieldName ())
45+ : null ;
4246 }
4347 return $ this ->id ;
4448 }
4549
4650 /**
51+ * Sets ID.
52+ *
4753 * @param int $id
4854 * @return void
4955 */
You can’t perform that action at this time.
0 commit comments