When updating code from beta4 to beta5, update 7007 gave this error message in drush.
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal7_ataglanc.atag_taxonomy_term_data' doesn't exist
Performed update: metatag_update_7007
The taxonomy module is not compulsory but there is no guard on an attempt to join its table in metatag_update_7007().
<?php
$result = db_query("DELETE m
FROM {metatag} m
LEFT OUTER JOIN {taxonomy_term_data} t
ON m.entity_id=t.tid
WHERE m.entity_type='taxonomy_term'
AND t.tid IS NULL");
if ($result->rowCount() > 0) {
drupal_set_message(t('Removed @count meta tag record(s) for taxonomy terms that had been purged.', array('@count' => $result->rowCount())));
}
?>
The update proceeds even with this error as the update does not return a status array.
Comments
Comment #1
artis commentedI also ran into this issue on one of my sites. The workaround until this can get fixed is to turn on Taxonomy module, perform db updates, then turn off Taxonomy mondule.
Comment #2
damienmckennaSorry about that everyone :(
Comment #3
damienmckennaCommitted.
Comment #4
traveller commentedThe patch in #2 didn't help with upgrading the module on a Postgresql database. I'll get:
PDOException: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "m" LINE 1: DELETE m ^: DELETE m FROM {metatag} m LEFT OUTER JOIN {node} n ON m.entity_id=n.nid WHERE m.entity_type='node' AND n.nid IS NULL; Array ( ) in metatag_update_7007() (line 325 of /var/www/drupal/sites/all/modules/metatag/metatag.install).Not quite sure, if I'm doing something wrong, or is it a PSQL issue.
Comment #5
damienmckenna@traveller: Please open a new issue for this.
Comment #6
damienmckennaMarked #1961066: DB Update as a duplicate.
Comment #7
damienmckenna1.0-beta6 is out, so I'm closing this issue in the interest of keeping the issue queue clean.