- Issue created by @nessthehero
- π¦πΊAustralia almunnings Melbourne, π¦πΊ
Create a custom module. Eg:
In a mymodule.module file
use Drupal\media_library\Form\FileUploadForm; /** * Implements hook_media_source_info_alter(). * * - Disable dropzonejs for media library add form. */ function MYMODULE_media_source_info_alter(array &$sources) { if (!\Drupal::moduleHandler()->moduleExists('dropzonejs')) { return; } if (isset($sources['image'])) { $sources['image']['forms']['media_library_add'] = FileUploadForm::class; } if (isset($sources['video_file'])) { $sources['video_file']['forms']['media_library_add'] = FileUploadForm::class; } if (isset($sources['audio_file'])) { $sources['audio_file']['forms']['media_library_add'] = FileUploadForm::class; } if (isset($sources['file'])) { $sources['file']['forms']['media_library_add'] = FileUploadForm::class; } }
And in a mymodule.install file
/** * Implements hook_install(). */ function MYMODULE_install() { module_set_weight('mymodule', 50); }
This should disable it on the normal forms. Weight 50 is just a random number I chose, it just needs to run after dropzonejs module.