The following updates returned messages
offers_wants module
Update #7018
Failed: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 2: UPDATE {node} SET status=:db_update_placeholder_0 WHERE (nid IN ()) ; Array ( [:db_update_placeholder_0] => 1 ) in offers_wants_update_7018() (line 631 of /home/hoodhipp/public_html/sites/all/modules/offers_wants/offers_wants.install).

Comments

voughndutch created an issue.

matslats’s picture

Here's an updated version of that function.

function offers_wants_update_7018() {
  $default = variable_get('offers_wants_default_expiry', '+1 year');
  $default = str_replace('+', '-', $default);
  $query = db_select('node', 'n')->fields('n', array('nid', 'changed'));
  $query->join('offers_wants', 'ow', 'ow.nid = n.nid');
  $changed_nodes = $query->condition('n.type', 'proposition')
    ->condition('n.changed', strtotime($default), '>')
    ->condition('ow.end', 0)
    ->execute()->fetchAllKeyed();
  if ($changed_nodes) {
    db_update('node')
      ->fields(array('status' => 1))
      ->condition('nid', array_keys($changed_nodes))
      ->execute();
    db_update('node_revision')
      ->fields(array('status' => 1))
      ->condition('nid', array_keys($changed_nodes))
      ->execute();
    foreach ($changed_nodes as $nid => $changed) {
      db_query("UPDATE offers_wants SET end = :end WHERE nid = $nid", array(':end' => strtotime($default, $changed)));
    }
  }
  offers_wants_expire();
}

I'll push this code into the next version soon.