[open-ils-commits] [GIT] Evergreen ILS branch tags/rel_2_1_3 created. b42ccd9c80e609858da6c17502091543a6583d8f

Evergreen Git git at git.evergreen-ils.org
Thu Aug 23 09:44:33 EDT 2012


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, tags/rel_2_1_3 has been created
        at  b42ccd9c80e609858da6c17502091543a6583d8f (commit)

- Log -----------------------------------------------------------------
commit b42ccd9c80e609858da6c17502091543a6583d8f
Author: Dan Scott <dscott at laurentian.ca>
Date:   Wed Aug 22 14:09:45 2012 -0400

    Bumping version numbers and adding Changelog
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/ChangeLog b/ChangeLog
index 3323187..9e42d2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1 +1,253 @@
-#ChangeLog
+commit 3e5d3dac5ea261aa683ff467589f65f8ce72a4c7
+Author: Dan Scott <dscott at laurentian.ca>
+Date:   Tue Aug 21 21:36:39 2012 -0400
+
+    Add upgrade script for 2.1.2-2.1.3
+    
+    Signed-off-by: Dan Scott <dscott at laurentian.ca>
+
+114	0	Open-ILS/src/sql/Pg/version-upgrade/2.1.2-2.1.3-upgrade-db.sql
+4	4	README
+ create mode 100644 Open-ILS/src/sql/Pg/version-upgrade/2.1.2-2.1.3-upgrade-db.sql
+
+commit 1fe63a158ddedc3eb8f752e629889af0d6d3eb3b
+Author: Bill Erickson <berick at esilibrary.com>
+Date:   Thu Aug 16 15:40:58 2012 -0400
+
+    Sanity check cstore limit/offset param values
+    
+    Certain cstore calls (direct / json_query) that support limit/offset
+    params called with a non-string / non-numeric value
+    
+    e.g. { "limit": null }
+    
+    result in a cstore segfault as it tries to call atoi(NULL) under the
+    covers.  This patch prevents this by verifying that the limit/offset
+    values are actual strings or numbers (i.e. return a value from
+    jsonObjectGetString) and not JSON_NULL, etc.
+    
+    Signed-off-by: Bill Erickson <berick at esilibrary.com>
+    Signed-off-by: Dan Scott <dscott at laurentian.ca>
+
+20	12	Open-ILS/src/c-apps/oils_sql.c
+
+commit a5dd95f0bb2bbc3d4b6ea1e5ddd75f705a6ceadc
+Author: Dan Scott <dscott at laurentian.ca>
+Date:   Mon Jul 16 13:27:54 2012 -0400
+
+    Hide OPAC-invisible holdings from SRU/Z39.50
+    
+    The basic_holdings Supercat method filtered out deleted call numbers and
+    copies, but didn't filter out copies based on the OPAC visibility status
+    of copy location / status / the copy itself. This has undesired results
+    when third-party services request copies via SRU or Z39.50 and expose
+    copies that should not be visible to the public.
+    
+    We wrap all of the visibility and deletedness checks for a given copy up
+    into a subroutine so that we can avoid repeating ourselves in the
+    basic_holdings logic. Also, if we missed a test, we can add it in one
+    handy place :)
+    
+    (Thanks to Galen Charlton for finding two missing tests: circ lib
+    visibility and owning lib visibility!)
+    
+    Signed-off-by: Dan Scott <dscott at laurentian.ca>
+    Signed-off-by: Art Rhyno <art632000 at yahoo.ca>
+
+20	2	Open-ILS/src/perlmods/lib/OpenILS/Application/SuperCat.pm
+
+commit c8e6fa563f7e83be28783c81b8d7e13a7b8576aa
+Author: Melissa Lefebvre <mlefebvre at biblio.org>
+Date:   Tue Aug 14 12:58:18 2012 -0400
+
+    Change grammar for lost and missing failure messages
+    
+    Update to the lost and missing failure wording to make it
+    gramatically correct.  Removed the word "has" from both
+    messages.
+    
+    Signed-off-by: Melissa Lefebvre <mlefebvre at biblio.org>
+    Signed-off-by: Dan Scott <dscott at laurentian.ca>
+
+2	2	Open-ILS/src/extras/ils_events.xml
+
+commit caa9a9ee35f22c3f6b613bd7210887dc0e3b65f4
+Author: Steven Chan <schan at sitka.bclibraries.ca>
+Date:   Sun Jul 8 11:20:11 2012 -0700
+
+    Fix LP 829630, Show in Catalogue not working on Bills screen
+    
+    The page is looking for a messagecatalog XUL element with id
+    'catStrings', but is not finding it, and so we add it to the relevant
+    XUL file.
+    
+    It's odd why it is omitted, because a browse through the repository
+    doesn't show any changes that would explain the error.
+    
+    Signed-off-by: James Fournie <jfournie at sitka.bclibraries.ca>
+    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
+
+1	0	Open-ILS/xul/staff_client/server/patron/bill2.xul
+
+commit d66b20e415aebf2b3308f37cb25a6612ac1fcd19
+Author: Dan Scott <dscott at laurentian.ca>
+Date:   Fri Jul 27 16:27:29 2012 -0400
+
+    Use MARC::Field objects to append new fields
+    
+    While the deprecated MARC::Record::add_fields() method allows you to add
+    a list of fields using a list object, append_fields() requires
+    MARC::Field objects.
+    
+    Signed-off-by: Dan Scott <dscott at laurentian.ca>
+    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
+    
+    Conflicts:
+    	Open-ILS/src/sql/Pg/002.schema.config.sql
+
+8	10	Open-ILS/src/sql/Pg/002.functions.config.sql
+1	1	Open-ILS/src/sql/Pg/002.schema.config.sql
+103	0	Open-ILS/src/sql/Pg/upgrade/0726.schema.fix_maintain_901_regex.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/0726.schema.fix_maintain_901_regex.sql
+
+commit 08ad5769028661d8e8acf396443d346a3fe79ffb
+Author: Galen Charlton <gmc at esilibrary.com>
+Date:   Fri Jul 27 11:23:46 2012 -0400
+
+    lp1028514: fix syntax-o in PL/PERLU version of maintain_901()
+    
+    Signed-off-by: Galen Charlton <gmc at esilibrary.com>
+    Signed-off-by: Dan Scott <dscott at laurentian.ca>
+    
+    Conflicts:
+    	Open-ILS/src/sql/Pg/002.schema.config.sql
+
+2	2	Open-ILS/src/sql/Pg/002.functions.config.sql
+1	1	Open-ILS/src/sql/Pg/002.schema.config.sql
+105	0	Open-ILS/src/sql/Pg/upgrade/0725.schema.fix_maintain_901_regex.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/0725.schema.fix_maintain_901_regex.sql
+
+commit e88114f055088b634efd8f0aa3795b71176b1f9a
+Author: Dan Scott <dscott at laurentian.ca>
+Date:   Tue Jul 24 14:14:01 2012 -0400
+
+    Switch to a PLPERLU maintain_901() trigger function
+    
+    We've been burned by regexes that fail to grok XML properly numerous
+    times now. Standardizing on something that actually understands MARC
+    seems like a good idea.
+    
+    Signed-off-by: Dan Scott <dscott at laurentian.ca>
+    Signed-off-by: Mike Rylander <mrylander at gmail.com>
+
+94	57	Open-ILS/src/sql/Pg/002.functions.config.sql
+97	66	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_maintain_901_regex.sql
+
+commit b6e19563b0cfb7da2bfb73d3199b86678e5188ab
+Author: Galen Charlton <gmc at esilibrary.com>
+Date:   Tue Jul 24 11:51:52 2012 -0400
+
+    lp1028514: fix regex replace in maintain_901()
+    
+    The regex used to insert the 901 field can put the new
+    field in the wrong location if the MARCXML record being
+    modified uses namespace prefixes.  This patch tightens
+    the regexp to avoid this problem.
+    
+    Signed-off-by: Galen Charlton <gmc at esilibrary.com>
+    Signed-off-by: Dan Scott <dscott at laurentian.ca>
+
+4	4	Open-ILS/src/sql/Pg/002.functions.config.sql
+68	0	Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_maintain_901_regex.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.schema.fix_maintain_901_regex.sql
+
+commit 43dbf993a9a0a01c2a5a7948750accb2a2727541
+Author: Jason Etheridge <jason at esilibrary.com>
+Date:   Mon Jun 18 14:09:51 2012 -0400
+
+    patron name border color for Notes
+    
+    not Notes specifically, but this catches any non-alert non-blocking penalties
+    and prevents a colorless border from happening
+    
+    Colors chosen from mrpeters' patch at
+    https://bugs.launchpad.net/evergreen/+bug/921817
+    
+    Thanks!
+    
+    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
+    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
+    
+    Conflicts:
+    
+    	Open-ILS/xul/staff_client/server/skin/patron_display.css
+
+14	5	Open-ILS/xul/staff_client/server/skin/patron_display.css
+
+commit 1c31d5cab88fc70851e626b577b73c6e995a2c64
+Author: Bill Erickson <berick at esilibrary.com>
+Date:   Wed Nov 23 10:54:51 2011 -0500
+
+    Add constraint to ACQ PO state value
+    
+    Limit 'state' values to
+    
+    'new','pending','on-order','received','cancelled'
+    
+    https://bugs.launchpad.net/evergreen/+bug/893193
+    
+    Signed-off-by: Bill Erickson <berick at esilibrary.com>
+    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
+
+1	1	Open-ILS/src/sql/Pg/002.schema.config.sql
+2	1	Open-ILS/src/sql/Pg/200.schema.acq.sql
+10	0	Open-ILS/src/sql/Pg/upgrade/0722.schema.acq-po-state-constraint.sql
+ create mode 100644 Open-ILS/src/sql/Pg/upgrade/0722.schema.acq-po-state-constraint.sql
+
+commit 192ab45b37d5a37187d37a253a420c3578adf570
+Author: Ben Shum <bshum at biblio.org>
+Date:   Wed Jun 27 14:01:24 2012 -0400
+
+    Move Prefix field ahead of Names in patron editor
+    
+    In earlier versions of Evergreen (1.6 and earlier), the Prefix field
+    was used to enter title information, such as Mr., Mrs., etc. When the
+    field was eventually added to the newer patron registration screens
+    (2.0+), it was added before the patron's last name field. Ideally,
+    the prefix should be listed prior to the patron's first name instead.
+    
+    In addition, address label issues by changing "Suffix/Title" back to
+    only "Suffix" and making "Prefix" into "Prefix/Title".
+    
+    Note: string changes would normally not be allowed in a stable release,
+    however in this case the previous translation (if any) will still get
+    pulled from the IDL for the field in question, so English will not
+    suddenly start showing up in the patron registration form.
+    
+    Signed-off-by: Ben Shum <bshum at biblio.org>
+    Signed-off-by: James Fournie <jfournie at sitka.bclibraries.ca>
+    Signed-off-by: Dan Scott <dscott at laurentian.ca>
+
+2	2	Open-ILS/examples/fm_IDL.xml
+1	0	Open-ILS/web/templates/default/actor/user/register_table.tt2
+
+commit c243355bec838c7914129ed12ebea3b6dac80371
+Author: Bill Erickson <berick at esilibrary.com>
+Date:   Mon Jul 16 16:56:10 2012 -0400
+
+    Squelch uninitialized var warning from hold_copy_targeter
+    
+    open-ils.storage_stderr.log was getting filled with entries like:
+    
+    "Use of uninitialized value in concatenation (.) or string at
+    /usr/local/share/perl/5.10.1/OpenILS/Application/Storage/Publisher/action.pm"
+    
+    ... consuming disk space endlessly. Stop that!
+    
+    (Stealing Lebbeous' footwork and providing a slightly different solution.)
+    
+    Signed-off-by: Bill Erickson <berick at esilibrary.com>
+    Signed-off-by: Ben Shum <bshum at biblio.org>
+    Signed-off-by: Dan Scott <dscott at laurentian.ca>
+
+1	1	Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application.pm
index cd4dbbf..8f31239 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application.pm
@@ -6,7 +6,7 @@ use base qw/OpenSRF::Application/;
 sub ils_version {
     # version format is "x-y-z", for example "2-0-0" for Evergreen 2.0.0
     # For branches, format is "x-y"
-    return "HEAD";
+    return "2-1-3";
 }
 
 __PACKAGE__->register_method(
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index bb88a41..414ca5c 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -58,6 +58,7 @@ CREATE TABLE config.upgrade_log (
 );
 
 INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0726', :eg_version); -- denials
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('2.1.3', :eg_version);
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/xul/staff_client/chrome/content/main/about.html b/Open-ILS/xul/staff_client/chrome/content/main/about.html
index 2609bb6..c0f3220 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/about.html
+++ b/Open-ILS/xul/staff_client/chrome/content/main/about.html
@@ -1,7 +1,7 @@
 <html><head><script></script></head><body onload="var x = document.getElementById('version'); var version ='/xul/server/'.split(/\//)[2]; if (version == 'server') { version = 'versionless debug build'; } x.appendChild(document.createTextNode(version));">
 <h1 style="text-decoration: underline">Evergreen</h1>
 <p>Target Server ID: <span id="version"></span></p>
-<p>$HeadURL$</p>
+<p>http://git.evergreen-ils.org/Evergreen.git?h=refs/heads/rel_2_1_3</p>
 <h2>What is Evergreen?</h2>
 <blockquote>
 <p>
diff --git a/Open-ILS/xul/staff_client/defaults/preferences/prefs.js b/Open-ILS/xul/staff_client/defaults/preferences/prefs.js
index 19dcd2a..75bb971 100644
--- a/Open-ILS/xul/staff_client/defaults/preferences/prefs.js
+++ b/Open-ILS/xul/staff_client/defaults/preferences/prefs.js
@@ -11,7 +11,7 @@ pref("toolkit.singletonWindowType", "eg_main");
 pref("open-ils.enable_join_tabs", true);
 
 // We'll use this one to help brand some build information into the client, and rely on subversion keywords
-pref("open-ils.repository.headURL","$HeadURL$");
+pref("open-ils.repository.headURL","http://git.evergreen-ils.org/Evergreen.git?h=refs/heads/rel_2_1_3");
 pref("open-ils.repository.author","$Author$");
 pref("open-ils.repository.revision","$Revision$");
 pref("open-ils.repository.date","$Date$");
diff --git a/README b/README
index 95621e5..61decb8 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
-README for Evergreen 2.1.0a
-===========================
+README for Evergreen 2.1.3
+==========================
 
 Preamble: referenced user accounts
 ----------------------------------
@@ -38,8 +38,8 @@ the following commands as the *user* Linux account:
 
 [source, bash]
 ------------------------------------------------------------------------------
-wget -c http://evergreen-ils.org/downloads/Evergreen-ILS-2.1.0a.tar.gz
-tar xzf Evergreen-ILS-2.1.0a.tar.gz
+wget -c http://evergreen-ils.org/downloads/Evergreen-ILS-2.1.3.tar.gz
+tar xzf Evergreen-ILS-2.1.3.tar.gz
 ------------------------------------------------------------------------------
 
 Preamble: Developer instructions
@@ -172,7 +172,7 @@ Installation instructions
 +
 [source, bash]
 ------------------------------------------------------------------------------
-make STAFF_CLIENT_STAMP_ID=rel_2_1_0 install
+make STAFF_CLIENT_STAMP_ID=rel_2_1_3 install
 ------------------------------------------------------------------------------
 +
 2. The server portion of the staff client expects `http://hostname/xul/server`
diff --git a/configure.ac b/configure.ac
index dd0b098..565a94b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,8 +20,8 @@
 
 export PATH=${PATH}:/usr/sbin
 AC_PREREQ(2.61)
-AC_INIT(Open-ILS, trunk, open-ils-dev at list.georgialibraries.org)
-AM_INIT_AUTOMAKE([OpenILS], [trunk])
+AC_INIT(Open-ILS, 2.1.3, open-ils-dev at list.georgialibraries.org)
+AM_INIT_AUTOMAKE([OpenILS], [2.1.3])
 AC_REVISION($Revision: 0.1 $)
 AC_CONFIG_SRCDIR([configure.ac])
 AC_PREFIX_DEFAULT([/openils/])

commit a38f3579bea01d376e1f5964d6e1c1bd61a0e127
Author: Dan Scott <dscott at laurentian.ca>
Date:   Thu Aug 23 09:43:18 2012 -0400

    Add 2.1.2-2.1.3 database schema upgrade script
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/src/sql/Pg/version-upgrade/2.1.2-2.1.3-upgrade-db.sql b/Open-ILS/src/sql/Pg/version-upgrade/2.1.2-2.1.3-upgrade-db.sql
new file mode 100644
index 0000000..bec59a4
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/version-upgrade/2.1.2-2.1.3-upgrade-db.sql
@@ -0,0 +1,114 @@
+--Upgrade Script for 2.1.2 to 2.1.3
+BEGIN;
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('2.1.3', :eg_version);
+-- Evergreen DB patch 0722.schema.acq-po-state-constraint.sql
+--
+
+INSERT INTO config.upgrade_log (version) VALUES ('0722');
+
+ALTER TABLE acq.purchase_order ADD CONSTRAINT valid_po_state 
+    CHECK (state IN ('new','pending','on-order','received','cancelled'));
+
+
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0725', :eg_version); -- gmcharlt/denials
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0726', :eg_version); -- denials
+
+CREATE OR REPLACE FUNCTION evergreen.maintain_901 () RETURNS TRIGGER AS $func$
+use strict;
+use MARC::Record;
+use MARC::File::XML (BinaryEncoding => 'UTF-8');
+use MARC::Charset;
+use Encode;
+use Unicode::Normalize;
+
+MARC::Charset->assume_unicode(1);
+
+my $schema = $_TD->{table_schema};
+my $marc = MARC::Record->new_from_xml($_TD->{new}{marc});
+
+my @old901s = $marc->field('901');
+$marc->delete_fields(@old901s);
+
+if ($schema eq 'biblio') {
+    my $tcn_value = $_TD->{new}{tcn_value};
+
+    # Set TCN value to record ID?
+    my $id_as_tcn = spi_exec_query("
+        SELECT enabled
+        FROM config.global_flag
+        WHERE name = 'cat.bib.use_id_for_tcn'
+    ");
+    if (($id_as_tcn->{processed}) && $id_as_tcn->{rows}[0]->{enabled} eq 't') {
+        $tcn_value = $_TD->{new}{id}; 
+    }
+
+    my $new_901 = MARC::Field->new("901", " ", " ",
+        "a" => $tcn_value,
+        "b" => $_TD->{new}{tcn_source},
+        "c" => $_TD->{new}{id},
+        "t" => $schema
+    );
+
+    if ($_TD->{new}{owner}) {
+        $new_901->add_subfields("o" => $_TD->{new}{owner});
+    }
+
+    if ($_TD->{new}{share_depth}) {
+        $new_901->add_subfields("d" => $_TD->{new}{share_depth});
+    }
+
+    $marc->append_fields($new_901);
+} elsif ($schema eq 'authority') {
+    my $new_901 = MARC::Field->new("901", " ", " ",
+        "c" => $_TD->{new}{id},
+        "t" => $schema,
+    );
+    $marc->append_fields($new_901);
+} elsif ($schema eq 'serial') {
+    my $new_901 = MARC::Field->new("901", " ", " ",
+        "c" => $_TD->{new}{id},
+        "t" => $schema,
+        "o" => $_TD->{new}{owning_lib},
+    );
+
+    if ($_TD->{new}{record}) {
+        $new_901->add_subfields("r" => $_TD->{new}{record});
+    }
+
+    $marc->append_fields($new_901);
+} else {
+    my $new_901 = MARC::Field->new("901", " ", " ",
+        "c" => $_TD->{new}{id},
+        "t" => $schema,
+    );
+    $marc->append_fields($new_901);
+}
+
+my $xml = $marc->as_xml_record();
+$xml =~ s/\n//sgo;
+$xml =~ s/^<\?xml.+\?\s*>//go;
+$xml =~ s/>\s+</></go;
+$xml =~ s/\p{Cc}//go;
+
+# Embed a version of OpenILS::Application::AppUtils->entityize()
+# to avoid having to set PERL5LIB for PostgreSQL as well
+
+# If we are going to convert non-ASCII characters to XML entities,
+# we had better be dealing with a UTF8 string to begin with
+$xml = decode_utf8($xml);
+
+$xml = NFC($xml);
+
+# Convert raw ampersands to entities
+$xml =~ s/&(?!\S+;)/&amp;/gso;
+
+# Convert Unicode characters to entities
+$xml =~ s/([\x{0080}-\x{fffd}])/sprintf('&#x%X;',ord($1))/sgoe;
+
+$xml =~ s/[\x00-\x1f]//go;
+$_TD->{new}{marc} = $xml;
+
+return "MODIFY";
+$func$ LANGUAGE PLPERLU;
+
+COMMIT;

commit 1fe63a158ddedc3eb8f752e629889af0d6d3eb3b
Author: Bill Erickson <berick at esilibrary.com>
Date:   Thu Aug 16 15:40:58 2012 -0400

    Sanity check cstore limit/offset param values
    
    Certain cstore calls (direct / json_query) that support limit/offset
    params called with a non-string / non-numeric value
    
    e.g. { "limit": null }
    
    result in a cstore segfault as it tries to call atoi(NULL) under the
    covers.  This patch prevents this by verifying that the limit/offset
    values are actual strings or numbers (i.e. return a value from
    jsonObjectGetString) and not JSON_NULL, etc.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/src/c-apps/oils_sql.c b/Open-ILS/src/c-apps/oils_sql.c
index d30f427..38590e4 100644
--- a/Open-ILS/src/c-apps/oils_sql.c
+++ b/Open-ILS/src/c-apps/oils_sql.c
@@ -4847,12 +4847,16 @@ char* SELECT (
 
 	if( limit ){
 		const char* str = jsonObjectGetString( limit );
-		buffer_fadd( sql_buf, " LIMIT %d", atoi( str ));
+		if (str) { // limit could be JSON_NULL, etc.
+			buffer_fadd( sql_buf, " LIMIT %d", atoi( str ));
+		}
 	}
 
 	if( offset ) {
 		const char* str = jsonObjectGetString( offset );
-		buffer_fadd( sql_buf, " OFFSET %d", atoi( str ));
+		if (str) {
+			buffer_fadd( sql_buf, " OFFSET %d", atoi( str ));
+		}
 	}
 
 	if( !(flags & SUBSELECT) )
@@ -5370,21 +5374,25 @@ static char* buildSELECT ( const jsonObject* search_hash, jsonObject* rest_of_qu
 		const jsonObject* limit = jsonObjectGetKeyConst( rest_of_query, "limit" );
 		if( limit ) {
 			const char* str = jsonObjectGetString( limit );
-			buffer_fadd(
-				sql_buf,
-				" LIMIT %d",
-				atoi(str)
-			);
+			if (str) {
+				buffer_fadd(
+					sql_buf,
+					" LIMIT %d",
+					atoi(str)
+				);
+			}
 		}
 
 		const jsonObject* offset = jsonObjectGetKeyConst( rest_of_query, "offset" );
 		if( offset ) {
 			const char* str = jsonObjectGetString( offset );
-			buffer_fadd(
-				sql_buf,
-				" OFFSET %d",
-				atoi( str )
-			);
+			if (str) {
+				buffer_fadd(
+					sql_buf,
+					" OFFSET %d",
+					atoi( str )
+				);
+			}
 		}
 	}
 

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


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list