Karl Do you mean when someone clicks the contextmenu dropdown button on the right for the current dir
Yes. Here is me doing it:
https://i.imgur.com/1KUbF3A.mp4
Karl A modal will NEVER open if the item is not found in matchingItems
It is easy to reproduce. Set $root to point to an empty folder and do what I did, or right click the background and select "Show info" from there. Then check the console. I can reproduce on the latest version of Files Gallery with latest Firefox and Chrome.
Karl Sorry, it doesn't make sense.
So I took a moment and looked into why the second issue really occurs. It's true that the image is returned for the folder preview, but that's actually intentional, I misunderstood the codepath. It is minified after all, I did my best. Here's what I found.
The JS does not add the <a class="modal-preview-a"> element to the folder preview image if the file is missing the url_path value, and the var that fits the image into the preview div is set using that class. The url_path value is not sent over in the body <script> element if the file is outside of document root, which can happen in a supported configuration by simply setting your root to somewhere outside of docroot. (In that case, Files Gallery proxies the file, and it should be fine if url_path is empty.)
Karl Why not provide a link?
I've emailed you two test links that reproduce these issues.
Karl This looks like some badly implemented customization.
The test links do not have any customizations or changes to index.php, the JS, or anything else...
Regards.