[open-ils-commits] [GIT] Evergreen ILS branch rel_2_6 updated. 7b95863d9ad82224eb08ad4d64361adaaf351202

Evergreen Git git at git.evergreen-ils.org
Thu Feb 19 11:02:25 EST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_6 has been updated
       via  7b95863d9ad82224eb08ad4d64361adaaf351202 (commit)
       via  e0f739cf93d84badbd6a572feb06d77d964c35e0 (commit)
      from  8d8068f391b1bb6e363c410d8fe9af09cc5898f9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7b95863d9ad82224eb08ad4d64361adaaf351202
Author: Galen Charlton <gmc at esilibrary.com>
Date:   Thu Feb 19 15:59:33 2015 +0000

    LP#1418772: (follow-up) tweak undef-edness check
    
    Use the Perl defined() function rather than "eq undef"
    to avoid logging warnings about undefined values.
    
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
index 942c0ae..a9466b7 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
@@ -196,7 +196,7 @@ sub init_ro_object_cache {
         my $date = shift;
 
         # Calling parse_datetime() with empty $date will lead to Internal Server Error
-        return '' if ($date eq '' or $date eq undef);
+        return '' if (!defined($date) or $date eq '');
 
         # Probably an accidental entry like '0212' instead of '2012',
         # but 1) the leading 0 may get stripped in cstore and

commit e0f739cf93d84badbd6a572feb06d77d964c35e0
Author: Steven Chan <schan at sitka.bclibraries.ca>
Date:   Mon Jul 22 12:39:48 2013 -0700

    LP#1418772: Avoid internal server error on viewing full record when copy create_date is null
    
    In the TPAC client, when it tries to show record details containing a copy
    record with no create date, it shows an Internal Server Error instead.
    
    1. The error is caused by trying to execute the parse_datetime() method
    in the parse_date() function in the WWW/EGCatLoader/util.pm module with
    an empty date string. The function will normally translate a datetime
    string from the database to a datetime string that is formatted for TPAC
    templates.  The fix is to not execute parse_datetime() and just return
    an empty string.
    
    2. In the record/copy_table.tt2 template, if an empty datetime string is
    the value for copy_info.create_date, the format() method of the Date
    plugin will show the current datetime by default. The fix is to show '-'
    in its place, replicating the same template logic as for
    copy_info.due_date.
    
    Signed-off-by: Jeff Davis <jdavis at sitka.bclibraries.ca>
    
    Conflicts:
    	Open-ILS/src/templates/opac/parts/record/copy_table.tt2

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
index 2bc2c16..942c0ae 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
@@ -195,6 +195,9 @@ sub init_ro_object_cache {
     $ro_object_subs->{parse_datetime} = sub {
         my $date = shift;
 
+        # Calling parse_datetime() with empty $date will lead to Internal Server Error
+        return '' if ($date eq '' or $date eq undef);
+
         # Probably an accidental entry like '0212' instead of '2012',
         # but 1) the leading 0 may get stripped in cstore and
         # 2) DateTime::Format::ISO8601 returns an error as years
diff --git a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
index 409964b..a45b789 100644
--- a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
@@ -117,10 +117,16 @@ END; # FOREACH bib
                 [% copy_info.age_protect ?
                     ctx.get_crahp(copy_info.age_protect).name : l('None') | html %]
             </td>
-            <td headers='copy_header_create_date'>[% date.format(
-                ctx.parse_datetime(copy_info.create_date),
-                DATE_FORMAT
-            ) %]</td>
+            <td headers='copy_header_create_date'>[% 
+                IF copy_info.create_date;
+                    date.format(
+                        ctx.parse_datetime(copy_info.create_date),
+                        DATE_FORMAT
+                    );
+                ELSE;
+                   '-';
+                END;
+            %]</td>
             [% END # is_staff %]
             [% IF ctx.is_staff OR serial_holdings %]
             <td headers='copy_header_holdable'>[%  # Show copy/volume hold links to staff (without

-----------------------------------------------------------------------

Summary of changes:
 .../perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm   |    3 +++
 .../src/templates/opac/parts/record/copy_table.tt2 |   14 ++++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list