From 6aefc424c5e88ea2a324b43eb889866f9e28fe43 Mon Sep 17 00:00:00 2001 From: dbs Date: Wed, 27 Apr 2011 12:21:13 +0000 Subject: [PATCH] Consolidate on checking for integers for -full / -uris 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 git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_2_0@20337 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm index e2c6635a18..149a0b4051 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm @@ -259,7 +259,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. @@ -269,12 +269,12 @@ Otherwise, we won't return any holdings. sub parse_feed_type { my $type = shift; - if ($type =~ /-full$/o) { + if ($type =~ /-full$/o) { return 1; } - if ($type =~ /-uris$/o) { - return "uris"; + if ($type =~ /-uris$/o) { + return 2; } # Otherwise, we'll return just the facts, ma'am @@ -1477,8 +1477,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 == 'uris'); - $node->link(opac => $feed->unapi . "?id=$item_tag&format=opac") if ($flesh > 0 || $flesh == '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); } -- 2.11.0