[open-ils-commits] r20337 - branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/WWW (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Apr 27 08:21:14 EDT 2011
Author: dbs
Date: 2011-04-27 08:21:13 -0400 (Wed, 27 Apr 2011)
New Revision: 20337
Modified:
branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
Log:
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 <dscott at laurentian.ca>
Modified: branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
===================================================================
--- branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm 2011-04-27 12:16:56 UTC (rev 20336)
+++ branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm 2011-04-27 12:21:13 UTC (rev 20337)
@@ -259,7 +259,7 @@
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 @@
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 @@
$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);
}
More information about the open-ils-commits
mailing list