Skip to content

Instantly share code, notes, and snippets.

@junaidpv
Created September 2, 2015 13:04
Show Gist options
  • Select an option

  • Save junaidpv/1c3fa0e6484e123a1d96 to your computer and use it in GitHub Desktop.

Select an option

Save junaidpv/1c3fa0e6484e123a1d96 to your computer and use it in GitHub Desktop.
Patch media module to fix over count of file usage due to conflict with filefield_paths module.
diff --git a/modules/media_wysiwyg/includes/media_wysiwyg.file_usage.inc b/modules/media_wysiwyg/includes/media_wysiwyg.file_usage.inc
index cbc1e84..77611d4 100644
--- a/modules/media_wysiwyg/includes/media_wysiwyg.file_usage.inc
+++ b/modules/media_wysiwyg/includes/media_wysiwyg.file_usage.inc
@@ -12,7 +12,7 @@
* is heavy-handed, and should be replaced when Drupal's filter system is
* context-aware.
*/
-function media_wysiwyg_field_attach_insert($entity_type, $entity) {
+function media_wysiwyg_entity_insert($entity, $entity_type) {
_media_wysiwyg_filter_add_file_usage_from_fields($entity_type, $entity);
}
@@ -21,7 +21,7 @@ function media_wysiwyg_field_attach_insert($entity_type, $entity) {
*
* @see media_field_attach_insert().
*/
-function media_wysiwyg_field_attach_update($entity_type, $entity) {
+function media_wysiwyg_entity_update($entity, $entity_type) {
_media_wysiwyg_filter_add_file_usage_from_fields($entity_type, $entity);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment