mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
BUGFIX: newly added documents now appear at the top of the list
This commit is contained in:
parent
e9ee4c85a7
commit
745741344c
@ -45,8 +45,11 @@ class DMSUploadField extends UploadField {
|
||||
// Relate to the underlying page being edited.
|
||||
// Not applicable when editing the document itself and replacing it.
|
||||
$doc->addPage($record);
|
||||
|
||||
//increase the sort value by one for the newly uploaded document and every other document attached to this page
|
||||
DB::query("UPDATE DMSDocument_Pages SET DocumentSort=DocumentSort+1 WHERE SiteTreeID = $record->ID");
|
||||
}
|
||||
|
||||
|
||||
return $doc;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user