core icon indicating copy to clipboard operation
core copied to clipboard

No groups in Images From Library Selector

Open denis-gorin opened this issue 3 years ago • 4 comments

Field type of Image. Trying to get image From Library - can't view files grouped by directories. I see only one group named files

Details

Question Answer
Relevant Bolt Version 5.1.10
Install type Composer install

Take a look to response of async/list_files?location=files&type=images on Bolt 5.0.6 for ex.

image

we can see the 'root group' and the 'business group' (corresponding business directory)

and the same response on Bolt 5.1.10

image

the 'files group' in all entries

As I see, the reason is in vendor\bolt\core\src\Utils\FilesIndex.php where we set group for each file

'group' => basename($basePath)

I Can't understand yet why we pass the same value ($basePath) for all files entries...

denis-gorin avatar Jun 23 '22 06:06 denis-gorin

I'm not sure why/how this snuck in, but I've noticed this too. For Bolt 5.2 this is getting reworked, and it'll be easier to pick out images: https://github.com/bolt/core/pull/3227

bobdenotter avatar Jun 23 '22 06:06 bobdenotter

I am also interested in an improvement of the library files selector in 5.2. My app is in 5.1 for the moment and I needed to override the FileIndex to set the group property this way : group' => dirname($file->getRelativePathname()) The selector is still less user friendly than it was in the previous version of my app (Bolt v3) but it can make the job temporarly.

jodou92 avatar Mar 15 '23 10:03 jodou92