Consolidate on checking for integers for -full / -uris
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 27 Apr 2011 12:16:15 +0000 (12:16 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 27 Apr 2011 12:16:15 +0000 (12:16 +0000)
The check for an integer when $flesh eq 'uris' was throwing errors
and breaking authority browsing; rather than complicating matters
further, use an explicit integer for the return value when the format
ends with "-uris" so that we can simply test for an integer value
greater than 0.

Signed-off-by: Dan Scott <dscott@laurentian.ca>

git-svn-id: svn://svn.open-ils.org/ILS/trunk@20335 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm

index 329935b..1b0ae05 100644 (file)
@@ -273,7 +273,7 @@ with holdings information.
 The feed type could end with the string "-full", in which case we want
 to return call numbers, copies, and URIS.
 
-Or the feed type could be "-uris", in which case we want to return
+Or the feed type could end with "-uris", in which case we want to return
 call numbers and URIS.
 
 Otherwise, we won't return any holdings.
@@ -288,7 +288,7 @@ sub parse_feed_type {
     }
 
      if ($type =~ /-uris$/o) {
-        return "uris";
+        return 2;
     }
 
     # Otherwise, we'll return just the facts, ma'am
@@ -1491,8 +1491,8 @@ sub create_record_feed {
 
         $node->id($item_tag);
         #$node->update_ts(cleanse_ISO8601($record->edit_date));
-        $node->link(alternate => $feed->unapi . "?id=$item_tag&format=htmlholdings-full" => 'text/html') if ($flesh > 0 || $flesh eq 'uris');
-        $node->link(opac => $feed->unapi . "?id=$item_tag&format=opac") if ($flesh > 0 || $flesh eq 'uris');
+        $node->link(alternate => $feed->unapi . "?id=$item_tag&format=htmlholdings-full" => 'text/html') if ($flesh > 0);
+        $node->link(opac => $feed->unapi . "?id=$item_tag&format=opac") if ($flesh > 0);
         $node->link(unapi => $feed->unapi . "?id=$item_tag") if ($flesh);
         $node->link('unapi-id' => $item_tag) if ($flesh);
     }