BUGFIX: newly added documents now appear at the top of the list

This commit is contained in:
Julian Seidenberg 2012-09-21 15:45:05 +12:00
parent e9ee4c85a7
commit 745741344c

View File

@ -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;
}