Skip to content

Commit 3f1349b

Browse files
author
Andrii Lugovyi
committed
MAGETWO-40049: Admin > catalog page does not work in production mode
- instance object in $data
1 parent ec6d4e6 commit 3f1349b

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

app/code/Magento/Ui/etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
<type name="Magento\Framework\Data\Argument\Interpreter\Composite">
181181
<arguments>
182182
<argument name="interpreters" xsi:type="array">
183-
<item name="object" xsi:type="object">Magento\Framework\Data\Argument\Interpreter\Object</item>
183+
<item name="object" xsi:type="object">configurableObjectArgumentInterpreterProxy</item>
184184
<item name="configurableObject" xsi:type="object">configurableObjectArgumentInterpreterProxy</item>
185185
<item name="array" xsi:type="object">arrayArgumentInterpreterProxy</item>
186186
<item name="boolean" xsi:type="object">Magento\Framework\Data\Argument\Interpreter\Boolean</item>

lib/internal/Magento/Framework/View/Element/UiComponent/Argument/Interpreter/ConfigurableObject.php

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,22 @@ public function __construct(ObjectManagerInterface $objectManager, InterpreterIn
4040
*/
4141
public function evaluate(array $data)
4242
{
43-
if (!isset($data['argument'])) {
44-
throw new \InvalidArgumentException('Node "argument" required for this type.');
43+
if (isset($data['value'])) {
44+
$className = $data['value'];
45+
$arguments = [];
46+
} else {
47+
if (!isset($data['argument'])) {
48+
throw new \InvalidArgumentException('Node "argument" required for this type.');
49+
}
50+
foreach ($data['argument'] as $name => $argument) {
51+
$arguments[$name] = $this->argumentInterpreter->evaluate($argument);
52+
}
53+
if (!isset($arguments['class'])) {
54+
throw new \InvalidArgumentException('Node "argument" with name "class" is required for this type.');
55+
}
56+
$className = $arguments['class'];
57+
unset($arguments['class']);
4558
}
46-
foreach ($data['argument'] as $name => $argument) {
47-
$arguments[$name] = $this->argumentInterpreter->evaluate($argument);
48-
}
49-
if (!isset($arguments['class'])) {
50-
throw new \InvalidArgumentException('Node "argument" with name "class" is required for this type.');
51-
}
52-
$className = $arguments['class'];
53-
unset($arguments['class']);
5459

5560
return $this->objectManager->create($className, $arguments);
5661
}

0 commit comments

Comments
 (0)