1.20.x path.install path_update_1001()

Moves Backdrop Pathauto configuration to Path module configuration.

File

modules/path/path.install, line 94
Install, update, and uninstall functions for Path module.

Code

function path_update_1001() {
  $pathauto_config = config('pathauto.settings');
  if ($pathauto_config->isNew()) {
    return;
  }

  $path_config = config('path.settings');
  $pathauto_data = $pathauto_config->get();
  $path_data = $path_config->get();
  $path_data = array_merge($path_data, $pathauto_data);
  $path_config->setData($path_data);
  $path_config->save();
  $pathauto_config->delete();

  // Remove the entry for the pathauto module in the system table. This will
  // "disable" the module if present.
  db_query("DELETE FROM {system} WHERE name = 'pathauto' AND type = 'module'");
}