From c1fbf206283e52db46cc845ac4901c09d5ed501e Mon Sep 17 00:00:00 2001 From: Jeff Godin Date: Thu, 14 Mar 2013 14:15:28 -0400 Subject: [PATCH] Fix detection of empty Syndetics AC data elements Due to a change in how the vendor responds to requests for data elements which are not present for a requested title, we need to change how we detect "empty" data elements in the "data_exists" function. First, we check for the new "No Data Available" title element, then we check for the previously-used value of "error". This change resolves the symptom where the catalog would display tabs for "Author Notes", "Excerpt", "Table of Contents", on every record in the catalog, even when clicking each tab would show that the content was not present / available. Signed-off-by: Jeff Godin Signed-off-by: Ben Shum --- Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/Syndetic.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/Syndetic.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/Syndetic.pm index 287bbcfe48..a9ce2e0cf8 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/Syndetic.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/AddedContent/Syndetic.pm @@ -179,6 +179,7 @@ sub reviews_json { sub data_exists { my( $self, $data ) = @_; + return 0 if $data =~ m/No Data Available<\/title>/iog; return 0 if $data =~ m/<title>error<\/title>/iog; return 1; } -- 2.11.0