[Koha-patches] [PATCH] bug 4508: fix crash when editing patron attributes or message prefs
Galen Charlton
gmcharlt at gmail.com
Wed May 26 16:51:09 CEST 2010
When editing patron attributes or messaging preferences on the
patron editor, Koha would crash with the following error:
Software error:
Can't use an undefined value as an ARRAY reference at
/home/koha/kohaclone/C4/SQLHelper.pm line 186.
This would occur only when editing the specific attribute
or message preferences section, not when editing the entire
patron record.
Signed-off-by: Galen Charlton <gmcharlt at gmail.com>
---
members/memberentry.pl | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/members/memberentry.pl b/members/memberentry.pl
index c158285..5cb4d72 100755
--- a/members/memberentry.pl
+++ b/members/memberentry.pl
@@ -335,7 +335,10 @@ if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){
delete $newdata{'password'};
delete $newdata{'userid'};
}
- &ModMember(%newdata);
+ &ModMember(%newdata) unless scalar(keys %newdata) <= 1; # bug 4508 - avoid crash if we're not
+ # updating any columns in the borrowers table,
+ # which can happen if we're only editing the
+ # patron attributes or messaging preferences sections
if (C4::Context->preference('ExtendedPatronAttributes') and $input->param('setting_extended_patron_attributes')) {
C4::Members::Attributes::SetBorrowerAttributes($borrowernumber, $extended_patron_attributes);
}
--
1.7.0
More information about the Koha-patches
mailing list