function system_update_6009

6.x system.install system_update_6009()

The PHP filter is now a separate module.

Related topics

File

drupal-6.x/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;
}