Skip to content

Commit d148161

Browse files
committed
Fixes failed tests for Data Object
- fixed document data provider
1 parent 54a24c4 commit d148161

File tree

1 file changed

+8
-2
lines changed
  • lib/internal/Magento/Framework/View/Element/UiComponent/DataProvider

1 file changed

+8
-2
lines changed

lib/internal/Magento/Framework/View/Element/UiComponent/DataProvider/Document.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Magento\Framework\Api\AttributeValueFactory;
1111

1212
/**
13-
* Class Document
13+
* The document data provider
1414
*/
1515
class 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
*/

0 commit comments

Comments
 (0)