Issue 695: Add feature to allow unreferenced files to be deleted from apps#7320
Merged
labkey-susanh merged 24 commits intorelease25.11-SNAPSHOTfrom Jan 21, 2026
Merged
Conversation
XingY
reviewed
Jan 12, 2026
| addColumn(Column.FileExtension); | ||
| addColumn(Column.WebDavUrl); | ||
| addColumn(Column.WebDavUrlRelative); | ||
| if (AppProps.getInstance().isOptionalFeatureEnabled(ExpSchema.SAMPLE_FILES_TABLE)) |
Contributor
There was a problem hiding this comment.
Since this is file related, it could / should instead be added to ExpFilesTable instead. Even though exp.files doesn't support container filtering, since Exp.UnreferencedSampleFiles does return data.container field, this can be used as the correct request context to query UnreferencedSampleFiles at its own container.
Contributor
Author
There was a problem hiding this comment.
Since we want to be able to link to a filtered set of files from the Unreferenced Sample Files page that should include the subfolder files, we're leaving this on the Data table. The Files table does not include subfolder files and does not have a column that can be filtered on to show only the sample files.
cnathe
reviewed
Jan 13, 2026
experiment/src/org/labkey/experiment/api/ExpFilesTableImpl.java
Outdated
Show resolved
Hide resolved
api/src/org/labkey/api/exp/query/ExpUnreferencedSampleFilesTable.java
Outdated
Show resolved
Hide resolved
api/src/org/labkey/api/exp/query/ExpUnreferencedSampleFilesTable.java
Outdated
Show resolved
Hide resolved
labkey-nicka
approved these changes
Jan 13, 2026
…or files that were moved
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
Issue 695 - We generally do not remove files from the
@filesdirectory, so these files remain in the search index indefinitely. This causes some potential problems for some clients when users can discover, say, old SOPs that have subsequently been replaced and thus might follow incorrect procedures. Here we add the ability to delete the files that had been associated with sample file fields but are no longer referenced from the application and update theexp.datatable with a column that displays the reference counts for eachexp.datafile.Related Pull Requests
Changes
UnreferencedSampleFilesvirtual tableReferenceCountcolumn toexp.datatable.