I have migrated the instance from a MySQL 5.5 DB to Postgres 9.3. When uploading an image with the Drag & Drop Upload interface, the metatag module drops the following error:

PDOException: SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block: SELECT language, '' FROM {metatag} WHERE (entity_type = :type) AND (entity_id = :id) AND (revision_id = :revision); Array ( [:type] => file [:id] => 206 [:revision] => 0 ) in metatag_metatags_save() (line 518 of <drupal-instance>/profiles/openoutreach/modules/contrib/metatag/metatag.module)

It does not occur when using the standard file upload process, neither does it occur when using MySQL. I have tried installing the dev version of the module but the error persists.

Comments

damienmckenna’s picture

Version: 7.x-1.4 » 7.x-1.x-dev

If you don't specifically need meta tags on File pages, you might try disabling files on the advanced settings page (admin/config/search/metatags/settings).

What module provides the drag 'n drop UI?

schoash’s picture

I am getting the same error for the image field type. Also using postgres 9.3

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new912 bytes

Does this fix the problem?

damienmckenna’s picture

Can someone please test the patch above? Thanks.

damienmckenna’s picture

StatusFileSize
new2.32 KB

Lets expand this to skip saving meta tags for entities that don't support it.

Status: Needs review » Needs work

The last submitted patch, 6: metatag-n2455777-6.patch, failed testing.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new2.47 KB

Forgot to load the $entity first. Doh.

damienmckenna’s picture

Status: Needs review » Fixed

Committed.

  • DamienMcKenna committed 2d01320 on 7.x-1.x
    Issue #2455777 by DamienMcKenna: Don't try to save any {metatag} records...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.