Quantcast
Channel: Question and Answer » postgresql
Viewing all articles
Browse latest Browse all 1138

Postgres errors with Metatag module in combination with Drag and Drop File upload

$
0
0

After having migrated from a MySQL 5.5 to a Postgres 9.3 Database I encounter some issues in a Drupal OpenOutreach installation. I have a content type with a Drag & Drop Upload field to display images. Whenever I try to save the new content, I receive the following error caused by the Metatag module:

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>/var/www/arsleonis/profiles/openoutreach/modules/contrib/metatag/metatag.module)

It is the following function causing the error:

  // Handle scenarios where the metatags are completely empty. 
if (empty($metatags)) {
$metatags = array();
// Add an empty array record for each language.
$languages = db_query("SELECT language, ''
    FROM {metatag}
    WHERE (entity_type = :type)
    AND (entity_id = :id)
    AND (revision_id = :revision)",
  array(
    ':type'     => $entity_type,
    ':id'       => $entity_id,
    ':revision' => $revision_id,
  ))->fetchAllKeyed();
foreach ($languages as $oldlang => $empty) {
  $metatags[$oldlang] = array();
 }    
}

On MySQL everything worked out properly and so does it on a clean (new) install with a Postgres DB (chosen from the beginning).

I have already tried installing a different version of the modules, but this showed no results. Unfortunately I don’t even know where to look for what’s causing this error.


Viewing all articles
Browse latest Browse all 1138

Trending Articles