Bug 31393: Koha::Config: handle the special case for 'content' attribute
<key content="value"></key> was wrongly parsed as { key => 'value' } whereas it should be { key => { content => 'value' } } The 'content' attribute is used in shibboleth config Test plan: 1 Run `prove t/Koha/Config.t` Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> (cherry picked from commit6973625e7a
) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> (cherry picked from commit35ae7b467e
) Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
parent
06c8ea255f
commit
f69ae61625
3 changed files with 19 additions and 1 deletions
|
@ -239,7 +239,7 @@ sub _read_from_dom_node {
|
|||
delete $subconfig->{id};
|
||||
} else {
|
||||
my @keys = keys %$subconfig;
|
||||
if (1 == scalar @keys && $keys[0] eq 'content') {
|
||||
if (!$node->hasAttributes() && 1 == scalar @keys && $keys[0] eq 'content') {
|
||||
# An element with no attributes and no child elements becomes its text content
|
||||
$subconfig = $subconfig->{content};
|
||||
} elsif (0 == scalar @keys) {
|
||||
|
|
|
@ -131,6 +131,15 @@ subtest 'read_from_file() tests' => sub {
|
|||
}
|
||||
},
|
||||
'useshibboleth' => '0',
|
||||
'shibboleth' => {
|
||||
'autocreate' => '1',
|
||||
'matchpoint' => 'userid',
|
||||
'mapping' => {
|
||||
'userid' => { 'is' => 'uid' },
|
||||
'branchcode' => { 'content' => 'MAIN', 'is' => 'MAIN' },
|
||||
'categorycode' => { 'content' => 'STAFF' },
|
||||
},
|
||||
},
|
||||
'zebra_lockdir' => '/home/koha/var/lock/zebradb',
|
||||
'lockdir' => '__LOCK_DIR__',
|
||||
'use_zebra_facets' => '1',
|
||||
|
|
|
@ -111,6 +111,15 @@
|
|||
</mapping>
|
||||
</ldapserver>
|
||||
<useshibboleth>0</useshibboleth><!-- see C4::Auth_with_shibboleth for extra configs you must do to turn this on -->
|
||||
<shibboleth>
|
||||
<autocreate>1</autocreate>
|
||||
<matchpoint>userid</matchpoint> <!-- koha borrowers field to match against for authentication -->
|
||||
<mapping>
|
||||
<userid is="uid"></userid> <!-- mapping between koha borrowers field and shibboleth attribute name. AD FS should use eppn instead of uid. -->
|
||||
<branchcode content="MAIN" is="MAIN"></branchcode>
|
||||
<categorycode content="STAFF"></categorycode>
|
||||
</mapping>
|
||||
</shibboleth>
|
||||
<zebra_lockdir>/home/koha/var/lock/zebradb</zebra_lockdir>
|
||||
<lockdir>__LOCK_DIR__</lockdir>
|
||||
<use_zebra_facets>1</use_zebra_facets>
|
||||
|
|
Loading…
Reference in a new issue