Framework Merge #2461: Implemented a fix regarding folders showing under a file treedropdown.

This is in reference to both:

https://github.com/silverstripe/silverstripe-framework/pull/2461
https://github.com/silverstripe/silverstripe-framework/pull/2989