Hi Gang,
I noticed today while attempting to output files that live in a File Set using the Document Library Block that the folders appear in the block output even though no folder was selected. I created a demo site so I could test in your environment http://testing.e8kp.cloud.concrete5.io/test-file-download-block
Here is a quick overview video:
https://monosnap.com/file/VNRUO65FojlxS1YxefuSTTy2b1SpcH
@ebell14 i think the problem is in setupFolderFileSetFilterfunction in \concrete\blocks\document_library\controller.php. There you can see that in both cases(any,all) the expression nt.treeNodeTypeHandle = "file_folder" is used in an OR expression which includes all folders without checking if they are containing files in the spesific set.
@aembler the question is : Do we still need the folder/subfolder structure when a filter by fileset is used ? If not, meaning we can show just a flat list of filtered files, then the problem could be solved by adding $list->enableSubFolderSearch() and remove nt.treeNodeTypeHandle = "file_folder" expressions in setupFolderFileSetFilterfunction.
@dimger – no, we don't. I could see adding a secondary option eventually for when you want to show folders AND only show files within those folders that match a certain file set, but this seems like a pretty unlikely case.
For my use I would really need to see the option to keep the folder structure when filtering by sets.
I'm using a multilingual site and want to use sets to restrict which files to show for the different languages. Several of our document librarys are organized in subfolders, and just showing all files in a flat structure would not work for me.
Maybe there is a different approach for multilingual use, but file sets seems to be the easiest way for my editors to handle the visibility.
Most helpful comment
@dimger – no, we don't. I could see adding a secondary option eventually for when you want to show folders AND only show files within those folders that match a certain file set, but this seems like a pretty unlikely case.