-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Asset paths are treated case-insensitive for content, but case-sensitive for metadata #353
Comments
Might be slightly related to statamic/cms#5595. |
What collation is your database using? I'm guessing its case sensitive? |
In the example I am using a sqlite database. I am not 100 % sure, but what I have found, the default for sqlite databases is NOT to use NOCASE collation, which means: yes, it is case-sensitive. In production, where I originally stumbled over this problem, a postgres DB with UTF-8 collation is used, which is also case-sensitive. |
I'm torn as to whether we should fix this or not. It's entirely feasible your database is case sensitive and your filesystem is too, in which case the current behaviour is expected, not a bug. My feeling would be if you are wanting case insensitivity you should also make a migration to set the assets columns to be case insensitive. |
Bug description
After creating and saving an asset using eloquent-driver, the used AssetContainer returns
true
when checking for existence of a file on the same path and same name, except the filename uses different upper- or lower-case letters than the asset from before.This might be expected behavior, especially when config
statamic.assets.lowercase = true
, however when trying to read meta-data of the file with differing case filename nothing is returned.Expected behavior
If filenames (or paths?) are treated case-insensitive for handling the file's content, the same should be true for the file's metadata.
How to reproduce
A minimal example is given in a test case here
https://github.com/faltjo/eloquent-driver-case-sensitive-filenames
git clone https://github.com/faltjo/eloquent-driver-case-sensitive-filenames
composer install
php artisan key:generate
./vendor/bin/pest
Logs
No response
Environment
Additional details
No response
The text was updated successfully, but these errors were encountered: