1 redirect.install redirect_update_1003()

Explicitly set the redirect status code and remove the default fallback.

File

core/modules/redirect/redirect.install, line 164
Install, update and uninstall functions for the Redirect module.

Code

function redirect_update_1003() {
  $config = config('redirect.settings');
  $default_status = $config->get('default_status_code');
  $additional_statuses = !in_array($default_status, array(301, 302));
  $config->clear('default_status');
  $config->clear('warning');
  $config->set('additional_statuses', $additional_statuses);
  $config->save();

  db_query("UPDATE {redirect} SET status_code = :default_status WHERE status_code = 0", array(':default_status' => $default_status));
}