Added ability to search using file ID in File Manager; #4471#4476
Added ability to search using file ID in File Manager; #4471#4476
Conversation
|
|
||
| if ($search_terms) { | ||
| $files->search(['title', 'file_name', 'mime_type'], $search_terms); | ||
| if (is_numeric($search_terms) && strlen($search_terms) < 3) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Added ability to search using file ID in File Manager; #4471