Bug 16285 - write_age() function throws error for patron categories that don't includ...
authorNick Clemens <nick@bywatersolutions.com>
Mon, 18 Apr 2016 16:07:46 +0000 (16:07 +0000)
committerBrendan Gallagher <bredan@bywatersolutions.com>
Wed, 20 Apr 2016 18:36:51 +0000 (18:36 +0000)
To test:
1 Add a patron in category Library or School
2 Note the js error in the console
3 Apply patch
4 Repeat and note the error is gone

Signed-off-by: Chris Cormack <chrisc@catalyst.net.z>
Made it an explicit if, and fixed the author of the commit

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher <bredan@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt

index d54c29e..4f328d5 100644 (file)
@@ -18,7 +18,9 @@ $(document).ready(function() {
        [% END %]
        $("#dateofbirth").datepicker({ maxDate: "-1D", yearRange: "c-120:" });
        dateformat = $("#dateofbirth").siblings(".hint").first().html();
-       write_age();
+    if( $('#dateofbirth').length ) {
+        write_age();
+    }
        $("#entryform").validate({
                rules: {
                        email: {