mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Sorting: Updated sort set command, Changed sort timestamp handling
- Renamed AssignSortSetCommand to AssignSortRuleCommand, updated contents and testing. - Updated sorting operations to not update timestamps if only priority is changed.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace BookStack\Sorting;
|
||||
|
||||
use BookStack\App\Model;
|
||||
use BookStack\Entities\Models\Book;
|
||||
use BookStack\Entities\Models\BookChild;
|
||||
use BookStack\Entities\Models\Chapter;
|
||||
@@ -57,7 +58,7 @@ class BookSorter
|
||||
|
||||
foreach ($topItems as $index => $topItem) {
|
||||
$topItem->priority = $index + 1;
|
||||
$topItem->save();
|
||||
$topItem::withoutTimestamps(fn () => $topItem->save());
|
||||
}
|
||||
|
||||
foreach ($chapters as $chapter) {
|
||||
@@ -68,7 +69,7 @@ class BookSorter
|
||||
|
||||
foreach ($pages as $index => $page) {
|
||||
$page->priority = $index + 1;
|
||||
$page->save();
|
||||
$page::withoutTimestamps(fn () => $page->save());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -166,7 +167,7 @@ class BookSorter
|
||||
}
|
||||
|
||||
if ($chapterChanged || $priorityChanged) {
|
||||
$model->save();
|
||||
$model::withoutTimestamps(fn () => $model->save());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user