Skip to content

Conversation

@intoeetive
Copy link
Contributor

Added ability to search using file ID in File Manager; #4471

@intoeetive intoeetive added this to the 7.x milestone Sep 14, 2024
@TomJaeger TomJaeger modified the milestones: 7.x, 7.5.14 Aug 5, 2025
@TomJaeger TomJaeger merged commit a39852e into 7.dev Aug 6, 2025
@TomJaeger TomJaeger deleted the feature/7.x/filter-by-file-id branch August 6, 2025 14:54

if ($search_terms) {
$files->search(['title', 'file_name', 'mime_type'], $search_terms);
if (is_numeric($search_terms) && strlen($search_terms) < 3) {
Copy link
Contributor

@litzinger litzinger Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that a file_id of 3 or more digits can't be searched? E.g. I can search for file #23, but not #456?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I just did a test for file 17 locally, and it returned file_id=17, then I tried 119, and it returned 3 files, all had 119 in the file name (they're really long random file names), but it did not return the file with the actual file_id=119.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's interesting, the search() on line 132 should be looking in the file_id field as well now. But I just did a similar test and got the same result as you @litzinger. This needs another look.

I think I would also prefer doing a more performant filter() when the search term looks like id:12345. But regardless we should be searching inside the file_id along with the other fields as this original change intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants