]> git.koha-community.org Git - koha.git/commit
Bug 10900 - Incorrect calling conventions accessing C4::Context
authorMark Tompsett <mtompset@hotmail.com>
Sat, 21 Sep 2013 01:36:46 +0000 (21:36 -0400)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 9 Feb 2015 20:00:13 +0000 (17:00 -0300)
commit78d6d794fe79e1fb61f4e695f3d25d6c0a4a20bf
tree3fb9616ef95ee1ca0a0b4077716c4dd4b72a5acf
parent78994d2ddaff12d7e196b4fb213311d6da8620d1
Bug 10900 - Incorrect calling conventions accessing C4::Context

There were multiple calling conventions for C4::Context's
set_userenv routine. So the following commands were used to
find discrepancies:
    grep "::set_userenv" `find .`
    grep "\->set_userenv" `find .`

The first grep demonstrated that the smaller change is from
:: to -> as only C4/Auth.pm, installer/InstallAuth.pm, and
t/db_dependent/Circulation.t would need to be modified. This
patch corrects C4::Context's set_userenv routine to be object
call based (use ->) by using a shift to ignore the first
parameter, and modify the three files found with :: calls.

As the result of trying to roll a distribution,
t/Circulation_barcodedecode.t was discovered to be faulty. The
cause being incorrect parameters! This was hidden when there
was no shift in the set_userenv routine. However, with its
correction, the test broke.

This led me to read the POD documentation for the function
set_userenv in C4::Context and realize it was outdated as
well. It has been revised to match the current version of
the function.

Then intentionally bad parameters passed to the set_userenv
routine in C4::Context were hunted down. The biggest problems
were missing surnames or branch names.

Rebase required because of shibboleth change in C4/Context.pm

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/Auth.pm
C4/Context.pm
C4/InstallAuth.pm
t/Circulation_barcodedecode.t
t/db_dependent/Circulation.t