diff --git a/core/includes/path.inc b/core/includes/path.inc index 07aeee5..dc878c0 100644 --- a/core/includes/path.inc +++ b/core/includes/path.inc @@ -72,7 +72,7 @@ function drupal_lookup_path($action, $path = '', $langcode = NULL) { // Retrieve the path alias whitelist. if (!isset($cache['whitelist'])) { - $cache['whitelist'] = variable_get('path_alias_whitelist', NULL); + $cache['whitelist'] = state()->get('system.path_alias_whitelist', NULL); if (!isset($cache['whitelist'])) { $cache['whitelist'] = drupal_path_alias_whitelist_rebuild(); } @@ -391,7 +391,7 @@ function drupal_path_alias_whitelist_rebuild($source = NULL) { // When paths are inserted, only rebuild the whitelist if the system path // has a top level component which is not already in the whitelist. if (!empty($source)) { - $whitelist = variable_get('path_alias_whitelist', NULL); + $whitelist = state()->get('system.path_alias_whitelist', NULL); if (isset($whitelist[strtok($source, '/')])) { return $whitelist; } @@ -404,7 +404,7 @@ function drupal_path_alias_whitelist_rebuild($source = NULL) { foreach ($result as $row) { $whitelist[$row->path] = TRUE; } - variable_set('path_alias_whitelist', $whitelist); + state()->set('system.path_alias_whitelist', $whitelist); return $whitelist; } diff --git a/core/modules/system/system.install b/core/modules/system/system.install index b1cf375..3b1df1f 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -2155,6 +2155,18 @@ function system_update_8027() { } /** +* Convert path_alias_whitelist variable to system.path_alias_whitelist state api values. +* +* @ingroup state_upgrade +*/ +function system_update_8028() { + if ($value = update_variable_get('path_alias_whitelist', FALSE)) { + state()->set('system.path_alias_whitelist', $value); + } + update_variable_del('path_alias_whitelist'); +} + +/** * @} End of "defgroup updates-7.x-to-8.x". * The next series of updates should start at 9000. */