Skip to content

Commit ba649a0

Browse files
author
Maxim Medinskiy
committed
MAGETWO-5824: PHP - Hide/Show Column
1 parent 52bce12 commit ba649a0

File tree

1 file changed

+22
-0
lines changed
  • app/code/Magento/Ui/Controller/Adminhtml/Bookmark

1 file changed

+22
-0
lines changed

app/code/Magento/Ui/Controller/Adminhtml/Bookmark/Save.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ public function execute()
113113
*/
114114
protected function updateBookmark(BookmarkInterface $bookmark, $identifier, $title, array $config = [])
115115
{
116+
$this->filterVars($config);
116117
$bookmark->setUserId($this->userContext->getUserId())
117118
->setNamespace($this->_request->getParam('namespace'))
118119
->setIdentifier($identifier)
@@ -152,4 +153,25 @@ protected function checkBookmark($identifier)
152153

153154
return $result;
154155
}
156+
157+
/**
158+
* Filter boolean vars
159+
*
160+
* @param array $data
161+
* @return void
162+
*/
163+
protected function filterVars(array & $data = [])
164+
{
165+
foreach ($data as & $value) {
166+
if (is_array($value)) {
167+
$this->filterVars($value);
168+
} else {
169+
if ($value == 'true') {
170+
$value = true;
171+
} elseif ($value == 'false') {
172+
$value = false;
173+
}
174+
}
175+
}
176+
}
155177
}

0 commit comments

Comments
 (0)