From 41549bf3f4aa1f87060c7e27ab27e6932359211c Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 18 Apr 2016 16:07:46 +0000 Subject: [PATCH] Bug 16285 - write_age() function throws error for patron categories that don't include dateofbirth in form 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 Made it an explicit if, and fixed the author of the commit Signed-off-by: Katrin Fischer Signed-off-by: Brendan Gallagher --- .../intranet-tmpl/prog/en/modules/members/memberentrygen.tt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index d54c29ea7f..4f328d51b7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -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: { -- 2.39.5