-
Notifications
You must be signed in to change notification settings - Fork 83
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
Extension-based filters not working as expected #109
Comments
@glen-84 AFAIK, filtering applies to single assets (or asset collections) - not automagically applied |
@Ocramius Nooooo, I don't wanna have to list every single file. :-( Assetic supports glob assets which are collections ... does AssetManager support this? Edit: Actually that would probably merge them, which I don't want. |
@grizzm0 can you provide feedback here? Seems like you have a solution |
Sorry, took this discussion on IRC instead. Simply replace 'less' with 'css' in the filters array. It's based on mime type and not extension from the looks of it. And less has the mime of text/css. |
Right, this works:
TBH, I don't understand how AM distinguishes between a mime type and an extension. For example:
Is 'less' a mime type or an extension here? I intended for it to be an extension, but it seems that this doesn't work. Perhaps it should be more like:
|
The problem is that the extension is determined base on the mime type of the file, not the actual extension. Have a look at https://github.com/RWOverdijk/AssetManager/blob/master/src/AssetManager/Service/AssetFilterManager.php#L75-L82 and https://github.com/RWOverdijk/AssetManager/blob/master/src/AssetManager/Service/MimeResolver.php#L577-L584. Let's say I have this configuration:
and I'm trying to load the file
So, basically, if the extension comes back as
Have a look at
The issue is that I believe the best solution here is to use php's Remove: This will give us the file's actual extension regardless of the mimetype. I would happily send a PR for this, but I can't get the test suite to run and there are no instructions on how to do so. :) |
The instructions are in the travis file :) We could match against both extensions, as to not break BC, but I'm not sure if we really want that. If you do so, the files will be stored as less, too. That will cause problems for most people. |
Oh yeah! Oops... I will blame my failure to notice that on not having had enough coffee yesterday. :) I'm not sure what you mean about the files being stored as less too, though. If you mean that The |
This doesn't work:
This does:
Am I misunderstanding how extension-based filters work?
The text was updated successfully, but these errors were encountered: