You are here

function system_update_6009 in Drupal 6

The PHP filter is now a separate module.

Related topics

File

modules/system/system.install, line 1378

Code

function system_update_6009() {
  $ret = array();

  // If any input format used the Drupal 5 PHP filter.
  if (db_result(db_query("SELECT COUNT(format) FROM {filters} WHERE module = 'filter' AND delta = 1"))) {

    // Enable the PHP filter module.
    $ret[] = update_sql("UPDATE {system} SET status = 1 WHERE name = 'php' AND type = 'module'");

    // Update the input filters.
    $ret[] = update_sql("UPDATE {filters} SET delta = 0, module = 'php' WHERE module = 'filter' AND delta = 1");
  }

  // With the removal of the PHP evaluator filter, the deltas of the line break
  // and URL filter have changed.
  $ret[] = update_sql("UPDATE {filters} SET delta = 1 WHERE module = 'filter' AND delta = 2");
  $ret[] = update_sql("UPDATE {filters} SET delta = 2 WHERE module = 'filter' AND delta = 3");
  return $ret;
}