Closed (fixed)
Project:
Sophron
Version:
3.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
16 Apr 2025 at 21:13 UTC
Updated:
10 May 2025 at 13:54 UTC
Jump to comment: Most recent
SophronMimeTypeMapFactory extends MimeTypeMapFactory and overrides the ::create() method. However, this could be changed upstream and changes would need to be duplicated.
Instead it should override the \Drupal\Core\File\MimeType\MimeTypeMapFactory::doCreateMap() method.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
mondrakeGood point, thanks @kim.pepper
Comment #5
mondrakeI think we should add a test to check if
DummyMimeTypeMapLoadedSubscriberhas an effect on the mapping. The legacy hook was already not processed by Sophron, but now that we have an API we should be able to process the event. This event will trigger 'core' changes, while the Sophron'sinitializeMapwill be specific to Sophron.In essence, the sequence should be:
a) the Sophron map is initialized in the
Drupal\sophron\MimeMapManagerInterfaceservice,initializeMapevent is triggered and will process map changes according tofileeye/mimemapprimitives;b) core triggers the
MimeTypeMapLoadedEventevent inMimeTypeMapFactoryand will process map changes according toMimeTypeMapprimitives (that are proxies to thefileeye/mimemapones via Sophron'sMimeMapManager).A bit complicated but this would allow keeping Sophron as a separate MIME type mapping service not used for guessing purposes.
Comment #6
mondrakeComment #7
mondrakeComment #9
mondrake