1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-13 02:04:35 +02:00

Fix issue in Lister bookmarks where columns could be lost for a non-superuser owned bookmark when modifying an existing bookmark

This commit is contained in:
Ryan Cramer
2022-04-19 09:56:04 -04:00
parent 89d46632b3
commit 78ae5e3f56

View File

@@ -534,7 +534,7 @@ class ProcessPageListerBookmarks extends Wire {
$bookmarkSelector = str_replace(', , ', ', ', $bookmarkSelector);
$bookmarkSelector = trim($bookmarkSelector, ', ');
if($bookmarkID) {
if($bookmarkID && $this->user->isSuperuser()) {
$bookmarkColumns = $input->post('bookmark_columns');
foreach($bookmarkColumns as $cnt => $column) {
$column = $sanitizer->name($column);
@@ -545,6 +545,8 @@ class ProcessPageListerBookmarks extends Wire {
}
}
$bookmarkColumns = array_values($bookmarkColumns);
} else if($bookmarkID && $existingBookmark) {
$bookmarkColumns = $existingBookmark['columns'];
} else {
$bookmarkColumns = $this->lister->columns;
}