List: delete data in subfolders#7563
Open
labkey-nicka wants to merge 2 commits intorelease26.3-SNAPSHOTfrom
Open
List: delete data in subfolders#7563labkey-nicka wants to merge 2 commits intorelease26.3-SNAPSHOTfrom
labkey-nicka wants to merge 2 commits intorelease26.3-SNAPSHOTfrom
Conversation
labkey-nicka
commented
Apr 8, 2026
| void deleteList(User user, @NotNull ListDefinitionImpl list, @Nullable String auditUserComment) throws DomainNotFoundException | ||
| { | ||
| var table = list.getTable(user); | ||
| var container = list.getContainer(); |
Contributor
Author
There was a problem hiding this comment.
There was not formerly a permissions check here for if the user could delete from this container but it seems like we could/should.
| filter.addCondition(FieldKey.fromParts("EntityId"), null, CompareType.NONBLANK); | ||
|
|
||
| // Delete attachments associated with a list in batches | ||
| new TableSelector(getDbTable(), new CsvSet("Container, EntityId"), filter, null).forEachBatch(ListRow.class, 1_000, rows -> { |
Contributor
There was a problem hiding this comment.
Hmm, we really need AttachmentService.deleteAttachments(SQLFragment sqlAttachmentParents)
labkey-matthewb
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale
This addresses #1013 by truncating rows across all lists that are in scope within a folder when the folder is deleted.
Changes
deleteRelatedListData()implementation to be defensive of orphaned rows containing no-longer-valid containersListManager