https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43782

--- Comment #6 from Martin Renvoize (ashimema) 
<[email protected]> ---
RM follow-up pushed to fix a CI failure caused by this bug (attachment 208603,
commit e386b282b60).

t/db_dependent/Koha/Plugins/TemplateIncludePathHook.t failed on main with "not
ok 6 - no warnings". GenerateCSRF builds its cache key from the session id, but
it is also rendered, through csrf-token.inc, in templates that have no
sessionID in their stash (that test renders such a template). It then warned
twice ("Use of uninitialized value $session_id in concatenation" and the same
for $csrf_token), which fails Test::NoWarnings, and it cached a token under a
session-less key.

A CSRF token is bound to a session, and Koha::Token->generate_csrf already
returns nothing when it is not given one, as GenerateCSRF did before this bug.
GenerateCSRF now returns early in the same way, before the cache key is built.
The new subtest 'GenerateCSRF - No session' in
t/db_dependent/Koha/Template/Plugin/Koha.t covers it; the tests added by this
bug always set a session, so they did not cover this case.

Test plan:
1. prove t/db_dependent/Koha/Plugins/TemplateIncludePathHook.t (it passes
again)
2. prove t/db_dependent/Koha/Template/Plugin/Koha.t (it passes, including the
new subtest)

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to