diff --git a/code/DMSDocument.php b/code/DMSDocument.php index 8e69fab..15a170a 100755 --- a/code/DMSDocument.php +++ b/code/DMSDocument.php @@ -390,8 +390,8 @@ class DMSDocument extends DataObject implements DMSDocumentInterface { if (file_exists($storageFolder)) { if ($handle = opendir($storageFolder)) { //Open directory //List files in the directory - while (false !== ($entry = readdir($handle))) { - if(strpos($entry,$this->ID.'~') !== false) $filesToDelete[] = $entry; + while (false !== ($entry = readdir($handle))) { //only delete if filename starts the the relevant ID + if(strpos($entry,$this->ID.'~') === 0) $filesToDelete[] = $entry; } closedir($handle); diff --git a/javascript/DMSDocumentCMSFields.js b/javascript/DMSDocumentCMSFields.js index 4c75e6a..274b159 100644 --- a/javascript/DMSDocumentCMSFields.js +++ b/javascript/DMSDocumentCMSFields.js @@ -76,10 +76,6 @@ //do an initial show of the entire panel this.show(); - //move the delete button into the panel - $('#Actions ul').append('
  • '); - $('.delete-button-appended').append($('#Form_ItemEditForm_action_doDelete')); - //add some extra classes to the replace field containers to make it work with drag and drop uploading this.find('.replace').closest('div.fieldgroup-field').addClass('ss-upload').addClass('ss-uploadfield');