Commit 91dbc137 authored by profix898's avatar profix898

- task: remove debug craft and unify item prefixes

parent cfb4c326
......@@ -140,12 +140,12 @@ function gallery_handle_request() {
else {
// Otherwise (on regular pages) $output means that an error occured
preg_match('%<div id="giStackTrace" [^>]*>(.*?)</div>%is', $output, $matches);
//gallery_error(t('Error handling request (invalid request)<br />or the requested Gallery URL does not exist.'), $matches[1], TRUE);
if (variable_get('gallery_error_redirect', 0) && user_access('search content')) {
drupal_set_message('The requested Gallery URL does not exist. It may have been moved or deleted.
You can search for the item below.', 'notice');
drupal_goto('search/gallery');
}
gallery_error(t('Error handling request (invalid request)<br />or the requested Gallery URL does not exist.'), $matches[1], TRUE);
return NULL;
}
}
......@@ -222,15 +222,18 @@ function gallery_item_details($id, $verbose = FALSE) {
return $details;
}
// Extract details
$details['type'] = $entity->entityType;
$details['g2type'] = $entity->entityType;
$details['g2owner'] = $entity->ownerId;
$details['g2parent'] = $entity->parentId;
// Drupal node properties (no g2 prefix)
$details['title'] = $entity->title;
$details['owner'] = $entity->ownerId;
$details['parent'] = $entity->parentId;
$details['created'] = $entity->creationTimestamp;
if ($verbose) {
$details['description'] = $entity->description;
$details['summary'] = $entity->summary;
$details['keywords'] = $entity->keywords;
$details['g2description'] = $entity->description;
$details['g2summary'] = $entity->summary;
$details['g2keywords'] = $entity->keywords;
$details['g2theme'] = $entity->theme;
}
return $details;
......
......@@ -52,8 +52,8 @@ function gallery_menu_page() {
if (isset($result['themeData']['pageUrl']['itemId'])) {
$id = $result['themeData']['pageUrl']['itemId'];
$item = gallery_item_details($id);
if ($item['type'] != 'GalleryAlbumItem') {
$id = $item['parent'];
if ($item['g2type'] != 'GalleryAlbumItem') {
$id = $item['g2parent'];
}
list($ret, $parents) = GalleryCoreApi::fetchParentSequence($id);
if ($ret) {
......
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