You are here

autotag.install in Taxonomy Autotagger 8.3

Same filename and directory in other branches
  1. 6.2 autotag.install
  2. 6 autotag.install
  3. 7.3 autotag.install

File

autotag.install
View source
<?php

/**
 * Convert all autotag_* variables to the new schema.
 */
function autotag_update_7001() {
  $values = db_select('variable', 'v')
    ->condition('name', 'autotag%', 'LIKE')
    ->fields('v')
    ->execute();
  foreach ($values as $value) {
    $parts = explode('_', $value->name);
    if (count($parts) >= 3) {
      array_shift($parts);
      array_shift($parts);
      $type = implode('_', $parts);
      $settings = variable_get('tagtag_node_' . $type, FALSE);
      if ($settings) {
        $settings['autotag']['autotag_vids'] = unserialize($value->value);
        variable_set('tagtag_node_' . $type, $settings);
      }
    }
  }
  db_delete('variable')
    ->condition('name', 'autotag%', 'LIKE')
    ->execute();
}

Functions

Namesort descending Description
autotag_update_7001 Convert all autotag_* variables to the new schema.