You are here

commerce_bpc.install in Commerce Bulk Product Creation 7

Same filename and directory in other branches
  1. 7.2 commerce_bpc.install

(Un)Install hook implementations for the Commerce Bulk product creation module.

File

commerce_bpc.install
View source
<?php

/**
 * @file
 * (Un)Install hook implementations for the Commerce Bulk product creation
 * module.
 */

/**
 * Implements hook_uninstall().
 */
function commerce_bpc_uninstall() {

  // Clean up variables.
  db_delete('variable')
    ->condition('name', 'commerce_bpc_%', 'LIKE')
    ->execute();
}

/**
 * Rewrite old tokens to new ones.
 */
function commerce_bpc_update_7101() {
  module_load_include('inc', 'commerce_bpc', 'commerce_bpc.settings');
  $title_pattern = commerce_bpc_setting('display', 'auto_node_title_pattern');
  if ($title_pattern) {
    commerce_bpc_setting_set('display', 'auto_node_title_pattern', str_replace('[bulk_display:title_fragment]', '[bulk_defaults:entered_title]', $title_pattern));
  }
  return t('Rewritten stored variables to use updated tokens');
}

/**
 * Fix rewritten tokens.
 */
function commerce_bpc_update_7102() {
  module_load_include('inc', 'commerce_bpc', 'commerce_bpc.settings');
  $title_pattern = commerce_bpc_setting('display', 'auto_node_title_pattern');
  if ($title_pattern) {
    commerce_bpc_setting_set('display', 'auto_node_title_pattern', str_replace('[bulk_defaults:title_fragment]', '[bulk_defaults:entered_title]', $title_pattern));
  }
  return t('Rewritten stored variables to use updated tokens');
}

Functions

Namesort descending Description
commerce_bpc_uninstall Implements hook_uninstall().
commerce_bpc_update_7101 Rewrite old tokens to new ones.
commerce_bpc_update_7102 Fix rewritten tokens.