Commit a47dce48 authored by fago's avatar fago

Issue #2003826 by greenmother, stella, jazzdrive3, fago: Fixed...

Issue #2003826 by greenmother, stella, jazzdrive3, fago: Fixed template_preprocess_entity does not check for existing 'path' index.
parent 4d2cc6fb
......@@ -169,7 +169,7 @@ function template_preprocess_entity(&$variables) {
$variables['title'] = check_plain(entity_label($entity_type, $entity));
$uri = entity_uri($entity_type, $entity);
$variables['url'] = $uri ? url($uri['path'], $uri['options']) : FALSE;
$variables['url'] = $uri && !empty($uri['path']) ? url($uri['path'], $uri['options']) : FALSE;
if (isset($variables['elements']['#page'])) {
// If set by the caller, respect the page property.
......@@ -177,7 +177,7 @@ function template_preprocess_entity(&$variables) {
}
else {
// Else, try to automatically detect it.
$variables['page'] = $uri && $uri['path'] == $_GET['q'];
$variables['page'] = $uri && !empty($uri['path']) && $uri['path'] == $_GET['q'];
}
// Helpful $content variable for templates.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment