You are here

function _hansel_get_original_path in Hansel breadcrumbs 8

Same name and namespace in other branches
  1. 7 hansel.module \_hansel_get_original_path()

Get the real path when alias is specified.

Parameters

string $path:

Return value

string

2 calls to _hansel_get_original_path()
hansel_ui_nodetypes_form_submit in hansel_ui/hansel_ui.module
Form submit callback.
hansel_ui_nodetypes_form_validate in hansel_ui/hansel_ui.module
Form validate callback.

File

./hansel.module, line 966
Hansel module

Code

function _hansel_get_original_path($path) {
  if (module_exists('path')) {
    $source = db_select('url_alias', 'ua')
      ->fields('ua', array(
      'source',
    ))
      ->condition('alias', $path)
      ->range(0, 1)
      ->execute()
      ->fetchField();
    if ($source) {
      return $source;
    }
  }
  return $path;
}