We have moved to GitHub Issues
Created by Emil Rasmussen 16 Dec 2016, 12:04:13 Updated by Sebastiaan Janssen 02 Nov 2017, 09:41:03
Relates to: U4-10612
Subtask of: U4-9272
Currently the media picker only filters the current folder of the media section tree. When dealing with large media libraries it would be advantageous to be able to search the entire depth of the media tree.
Our editors regularly moan about this as well. Would be a nice UX fix.
Yes. It is very unintuitive that the Content Picker has a search field, but the Media Picker has a filter field. I know there's a difference, but for most people search or filter is pretty much the same thing...
This has been a gripe of mine since I've started using Umbraco
What to test:
@madsrasmussen I've added comments to this PR I have concerns over this c# code due to both security and code duplication, it seems to me that it would be better suited to use the EntityController directly ? Let me know why we cannot do this, is it because the entity models don't contain all required data? If so we should see what we can do since the EntityBasic can contain an additionaldata collection to fill with data that may be required. We should also not have all of this code duplication.
@Shandem I'm a little confused on this one :D Anything we need to do to get this rolling? I have added an issue for the users, with no access to media, being logged out: http://issues.umbraco.org/issue/U4-9533
Adding notes from PR:
n the meantime, I'm leaving this in review, I'll remove all of the new code duplication that exists in the MediaController (ExamineSearch) (this is 100% unnecessary). We can keep MediaController.Search if we want, in which case we can add that to ContentController too. I'll also add EntityController.GetDescendants and EntityController.GetChildren since we need that for http://issues.umbraco.org/issue/U4-9470
So another thing to know about EntityController vs Media/Content Controller - The EntityController returns generic entities for all types, generally without any of it's properties. Media is slightly different because it's properties are put into the AdditionalData/metaData properties because for the most part all media user properties need to be known since that is where the media info is actually stored. The Entity returned from EntityController also tells you if the item HasChildren, the Content/Media Controllers do not. This is because the Content and Media objects returned from those controllers are complex models including all properties, content type, property type, etc... information. It is far to inefficient to make these models more complicated by also including if they have children.
@Shandem I've removed the duplicate code ExamineSearch and search endpoint from the MediaController. I've merged in the code from http://issues.umbraco.org/issue/U4-9470 to get the EntityService.GetPagedDescendants functionality and added the missing EntityController.GetPagedDescendants so we can use this one for the searching the media section from the media picker. So http://issues.umbraco.org/issue/U4-9470 should be merged in before this task. @madsrasmussen is working on updating the mediapicker to use the EntityController.GetPagedDescendants endpoint right now.
@Shandem and @emil:
I have updated the UI to use getPagedDescendants now.
I have found two issues:
@madsrasmussen I think I've fixed the 404. It happened for me when the endpoint didn't find anything then it was returning pagesize and pagenumber = 0 and then we were setting those value for the picker, so at next request it would send 0 for pagesize and pagenumber and the endpoint doesn't like that. I also fixed a bug where the mediagrid would fail loading when a folder was part of the search result. It's all in this commit: https://github.com/umbraco/Umbraco-CMS/pull/1753/commits/4dabb606e7e0daf7adb9c71c273dd62b7018b8e5
I haven't been able to reproduce the duplicate images in the result. Could you see if it's actually the same images that are returned?
@emil and @Shandem : I did some more testing on the duplicate images issue and the issue is it also searches the recycle bin. So I had two of every image but one of the sets were placed in the recycle bin.
I've pushed a fix for the searching in the recycle bin here: febeb82d10607dae81042983c29ff39f28952319 , I've left a comment on each of those other issues
@emil I've assigned back to you for review
Tested and verified that it doesn't find anything that is trashed now and I haven't been able to reproduce the duplicate images. The added code looks good and the search works great now.
This is awesome. Is it possible to have this functionality on lists? I have enabled list view on and in that list I documents (direct in list) but also I have documents grouped in folders. When I search I would like to get the result from all subfolders.
Many thanks, Florin
Type: Feature (request)
Backwards Compatible: True
Due in version: 7.6.0
Sprint: Sprint 53
Story Points: 1.5