Hi,

I've found an issue with the media_wysiwyg_entity_delete() hook implementation, it seems like it tries to delete any file usage references if any entity is being deleted. But in case of a non-fieldable entity the entity ID can be non-numeric which causes the following error if the site is installed with postgres:

PDOException: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "c" LINE 2: ... 'media') AND (type = 'codesnippets_config') AND (id = 'c') ^: DELETE FROM {file_usage} WHERE (module = :db_condition_placeholder_0) AND (type = :db_condition_placeholder_1) AND (id = :db_condition_placeholder_2) ; Array ( [:db_condition_placeholder_0] => media [:db_condition_placeholder_1] => codesnippets_config [:db_condition_placeholder_2] => c ) in media_wysiwyg_entity_delete() (line 151 of sites/all/modules/contrib/media/modules/media_wysiwyg/includes/media_wysiwyg.file_usage.inc).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yce created an issue. See original summary.

yce’s picture

joseph.olstad’s picture

Status: Active » Needs review

patch looks good so far, would be nice to have another review.
Good work thanks

  • joseph.olstad committed 9ef5a31 on 7.x-4.x authored by yce
    Issue #2944638 by yce: Error when trying to delete a non-fieldable...

  • joseph.olstad committed 9ef5a31 on 7.x-3.x authored by yce
    Issue #2944638 by yce: Error when trying to delete a non-fieldable...
joseph.olstad’s picture

Issue summary: View changes

This is released into 7.x-4.0-alpha2 bleeding edge
commit is included in 7.x-3.x dev
needs review for 7.x-2.x

Thanks.

joseph.olstad’s picture

Issue summary: View changes

2944638

joseph.olstad’s picture

Issue summary: View changes

my mouse is doing weird things

Chris Matthews’s picture

Status: Needs review » Closed (outdated)
Issue tags: -PostgreSQL, -wysiwyg, -file_usage, -hook_entity_delete

Recent versions of media have resolved most of peoples concerns and is compatible with entity translation, multilingual and various advanced configurations. Due to the high volume of inactive and most often irrelevant issues we are Closing this as (outdated). If for whatever reason this issue is important to you AND you still have issues after checking the media recipe documentation, then let us know and we will review your concerns.

Otherwise, see the recipe documentation for how to configure media and for troubleshooting tips OR refer to the media_dev distribution if you want to see a working media setup.

As mentioned, feel free to make some noise in this issue if you still feel it is important to you or someone else.

Thanks,

Media team