Commit 5520efe025a967884ef1b1b0efc1b8162e251755
1 parent
7279b98a
Modify Bulk Actions plugin to remove inefficient folder checking
Story ID:2295265. KTS-4574 Deleting deep folder structure kills server Fixed Committed by: Paul Barrett Reviewed by: MEgan Watson
Showing
1 changed file
with
3 additions
and
6 deletions
plugins/ktcore/KTBulkActions.php
| ... | ... | @@ -90,13 +90,10 @@ class KTBulkDeleteAction extends KTBulkAction { |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | // If all documents at the current level may be deleted, we can continue |
| 93 | - // Get any existing subfolders | |
| 94 | - $sWhereClause = "parent_folder_ids = '{$sFolderId}' OR | |
| 95 | - parent_folder_ids LIKE '{$sFolderId},%' OR | |
| 96 | - parent_folder_ids LIKE '%,{$sFolderId},%' OR | |
| 97 | - parent_folder_ids LIKE '%,{$sFolderId}'"; | |
| 93 | + // Get any existing subfolders - but ONLY on the current level, or we will be checking subfolders more than once! | |
| 94 | + $sWhereClause = "parent_id = '{$sFolderId}'"; | |
| 98 | 95 | $aChildFolders = $this->oFolder->getList($sWhereClause); |
| 99 | - | |
| 96 | + | |
| 100 | 97 | // Loop through subfolders and check each in the same way as the parent |
| 101 | 98 | if(!empty($aChildFolders)){ |
| 102 | 99 | foreach($aChildFolders as $oChild){ | ... | ... |