Commit 20120567 authored by kristiaanvandeneynde's avatar kristiaanvandeneynde Committed by fago

Issue #2112755 by phenaproxima, kristiaanvandeneynde, SchnWalter, ofry,...

Issue #2112755 by phenaproxima, kristiaanvandeneynde, SchnWalter, ofry, ruscoe, dangswiss: Fixed error 'Call to a member function label() on a non-object' in generated admin UI
parent 0a750f24
......@@ -184,8 +184,17 @@ function entity_ui_entity_page_view($entity) {
* Gets the page title for the passed operation.
*/
function entity_ui_get_page_title($op, $entity_type, $entity = NULL) {
module_load_include('inc', 'entity', 'includes/entity.ui');
$label = entity_label($entity_type, $entity);
if (isset($entity)) {
module_load_include('inc', 'entity', 'includes/entity.ui');
$label = entity_label($entity_type, $entity);
list(, , $bundle) = entity_extract_ids($entity_type, $entity);
}
else {
$info = entity_get_info($entity_type);
$label = $info['label'];
$bundle = NULL;
}
switch ($op) {
case 'view':
return $label;
......@@ -200,12 +209,7 @@ function entity_ui_get_page_title($op, $entity_type, $entity = NULL) {
case 'export':
return t('Export @label', array('@label' => $label));
}
if (isset($entity)) {
list(, , $bundle) = entity_extract_ids($entity_type, $entity);
}
else {
$bundle = NULL;
}
return entity_ui_get_action_title($op, $entity_type, $bundle);
}
......
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