File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
app/code/Magento/Catalog/Controller/Adminhtml/Product/Gallery Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 11
11
class Upload extends \Magento \Backend \App \Action
12
12
{
13
13
/**
14
- * @var \Magento\Framework\Controller\Result\JsonFactory
14
+ * @var \Magento\Framework\Controller\Result\RawFactory
15
15
*/
16
- protected $ resultJsonFactory ;
16
+ protected $ resultRawFactory ;
17
17
18
18
/**
19
19
* @param \Magento\Backend\App\Action\Context $context
20
- * @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
20
+ * @param \Magento\Framework\Controller\Result\RawFactory $resultRawFactory
21
21
*/
22
22
public function __construct (
23
23
\Magento \Backend \App \Action \Context $ context ,
24
- \Magento \Framework \Controller \Result \JsonFactory $ resultJsonFactory
24
+ \Magento \Framework \Controller \Result \RawFactory $ resultRawFactory
25
25
) {
26
26
parent ::__construct ($ context );
27
- $ this ->resultJsonFactory = $ resultJsonFactory ;
27
+ $ this ->resultRawFactory = $ resultRawFactory ;
28
28
}
29
29
30
30
/**
@@ -72,6 +72,10 @@ public function execute()
72
72
$ result = ['error ' => $ e ->getMessage (), 'errorcode ' => $ e ->getCode ()];
73
73
}
74
74
75
- return $ this ->resultJsonFactory ->create ()->setData ($ result );
75
+ /** @var \Magento\Framework\Controller\Result\Raw $response */
76
+ $ response = $ this ->resultRawFactory ->create ();
77
+ $ response ->setHeader ('Content-type ' , 'text/plain ' );
78
+ $ response ->setContents (json_encode ($ result ));
79
+ return $ response ;
76
80
}
77
81
}
You can’t perform that action at this time.
0 commit comments