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

--- Comment #53 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 209604
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209604&action=edit
Bug 42383: (QA follow-up) Prevent module policies from overriding globals

This patch makes Koha::Module::Policy->to_hashref add the 'global'
namespace after the subclass's _build_hashref keys. Before, the global
keys were added first, so a subclass returning a 'global' key would
silently replace them, contradicting the POD which states the global
keys cannot be overridden by subclasses.

A to_hashref() subtest is added, using a dummy subclass that tries to
override 'global'.

It addresses point 22 of the QA comment.

Test plan:
1. Apply the tests only
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Module/Policy.t
=> FAIL: The subclass overrides the global namespace
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Assisted-by: Opus 5.5 (Anthropic)

-- 
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