You are here

function amazon_update_7102 in Amazon Product Advertisement API 7

Same name and namespace in other branches
  1. 7.2 amazon.install \amazon_update_7102()

Amazon has stopped providing customer review data; now we only get an iframe link where Amazon will provide the data, so we need to drop the table that was used for customer reviews and add the new iframe link.

File

./amazon.install, line 144
Install, update and uninstall functions for the amazon module.

Code

function amazon_update_7102() {
  if (!db_field_exists('amazon_item', 'customerreviews_iframe')) {
    db_add_field('amazon_item', 'customerreviews_iframe', array(
      'type' => 'varchar',
      'length' => 255,
    ));
  }
  if (db_table_exists('amazon_item_customer_review')) {
    db_drop_table('amazon_item_customer_review');
  }

  // Expire all the existing amazon items so the next cron will update them.
  db_update('amazon_item')
    ->fields(array(
    'timestamp' => 0,
  ))
    ->execute();
  return t("Updated support for customer reviews");
}