[Koha-patches] [PATCH] [replace previous] bugfix error if memcached_servers is empty in koha-conf.xml

Michael Hafen mdhafen at tech.washk12.org
Thu Aug 27 00:43:59 CEST 2009


XML::Simple returns by default an empty hash ref if it encounters an xml tag
with no attributes or content.  If memcached_servers is empty, as the installer
sets it when this feature is disabled, then we get the empty hash ref.

In checking if memcached_servers is set the empty hash ref evaluates as true.
I.E.

  $servers = C4::Context->config('memcached_servers');
  if ($servers) {

so we get a comiler error from memcached trying to resolve the nonexistant
server address.
---
 C4/Context.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/C4/Context.pm b/C4/Context.pm
index 4dab9a9..99019ea 100644
--- a/C4/Context.pm
+++ b/C4/Context.pm
@@ -233,7 +233,7 @@ Returns undef in case of error.
 =cut
 
 sub read_config_file {		# Pass argument naming config file to read
-    my $koha = XMLin(shift, keyattr => ['id'], forcearray => ['listen', 'server', 'serverinfo']);
+    my $koha = XMLin(shift, keyattr => ['id'], forcearray => ['listen', 'server', 'serverinfo'], suppressempty => '');
     return $koha;			# Return value: ref-to-hash holding the configuration
 }
 
-- 
1.6.0.4




More information about the Koha-patches mailing list