Issue #2233607 by visabhishek: Kill path_load() and use \Drupal::service('path.alias_storage')->load($conditions) instead.
parent
cce2380be1
commit
2ccfe55330
|
@ -96,28 +96,6 @@ function current_path() {
|
|||
return _current_path();
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches a specific URL alias from the database.
|
||||
*
|
||||
* @param $conditions
|
||||
* A string representing the source, a number representing the pid, or an
|
||||
* array of query conditions.
|
||||
*
|
||||
* @see \Drupal\Core\Path\PathInterface::load()
|
||||
*/
|
||||
function path_load($conditions) {
|
||||
if (is_numeric($conditions)) {
|
||||
$conditions = array('pid' => $conditions);
|
||||
}
|
||||
elseif (is_string($conditions)) {
|
||||
$conditions = array('source' => $conditions);
|
||||
}
|
||||
elseif (!is_array($conditions)) {
|
||||
return FALSE;
|
||||
}
|
||||
return \Drupal::service('path.alias_storage')->load($conditions);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether a path is in the administrative section of the site.
|
||||
*
|
||||
|
|
|
@ -24,7 +24,7 @@ class PathController {
|
|||
* @todo Remove path_admin_edit().
|
||||
*/
|
||||
public function adminEdit($path) {
|
||||
$path = path_load($path);
|
||||
$path = \Drupal::service('path.alias_storage')->load(array('pid' => $path));
|
||||
module_load_include('admin.inc', 'path');
|
||||
return path_admin_edit($path);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue