Skip to content

Commit 2a1c635

Browse files
authored
Fix for big request data array
When assigning related blog posts and product than during post save a huge post array was send (including related product description, related post content), and this sometimes forward to 404 error on web server level due to the server configuration restrictions.
1 parent 987dbd2 commit 2a1c635

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Ui/DataProvider/Post/Form/PostDataProvider.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ public function getData()
105105
foreach ($collection as $item) {
106106
$itemData = $item->getData();
107107
$itemData['id'] = $item->getId();
108+
/* Fix for big request data array */
109+
foreach (['content', 'short_content', 'meta_description'] as $field) {
110+
if (isset($itemData[$field])) {
111+
unset($itemData[$field]);
112+
}
113+
}
114+
/* End */
108115
$items[] = $itemData;
109116
}
110117
$data['data']['links']['post'] = $items;
@@ -115,6 +122,14 @@ public function getData()
115122
foreach ($collection as $item) {
116123
$itemData = $item->getData();
117124
$itemData['id'] = $item->getId();
125+
/* Fix for big request data array */
126+
foreach (['description', 'short_description', 'meta_description'] as $field) {
127+
if (isset($itemData[$field])) {
128+
unset($itemData[$field]);
129+
}
130+
}
131+
/* End */
132+
118133
$items[] = $itemData;
119134
}
120135
$data['data']['links']['product'] = $items;

0 commit comments

Comments
 (0)