mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-09-30 05:09:13 +02:00
BUGFIX: newly added documents now appear at the top of the list
This commit is contained in:
parent
e9ee4c85a7
commit
745741344c
@ -45,6 +45,9 @@ class DMSUploadField extends UploadField {
|
|||||||
// Relate to the underlying page being edited.
|
// Relate to the underlying page being edited.
|
||||||
// Not applicable when editing the document itself and replacing it.
|
// Not applicable when editing the document itself and replacing it.
|
||||||
$doc->addPage($record);
|
$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;
|
return $doc;
|
||||||
|
Loading…
Reference in New Issue
Block a user