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

Pedro Amorim (ammopt) <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Passed QA                   |Failed QA

--- Comment #98 from Pedro Amorim (ammopt) <[email protected]> ---
Hi all, a few blockers here:

Setup (for all):
1) Apply the patches, then in `ktd --shell` run `updatedatabase &&
restart_all`.

Blocker 1: fresh installs don't get the new pref, and saved reports crash
1) Run `grep -n "LimitReportsBy" installer/data/mysql/mandatory/sysprefs.sql`.
Only `LimitReportsByLibrary` is there, and fresh installs only get prefs from
this file.
2) Run `prove t/db_dependent/check_sysprefs.t`. It reports "Too many sysprefs
in DB: LimitReportsBy", and the sort check finds `LimitReportsByLibrary` where
`LimitReportsBy` is expected.
3) To see what a fresh install would hit, remove the pref: `koha-mysql kohadev
-e "DELETE FROM systempreferences WHERE variable = 'LimitReportsBy'"`, then run
`restart_all`.
4) Open http://localhost:8081/cgi-bin/koha/reports/guided_reports.pl?op=list.
It fails with "Can't call method "unblessed" on an undefined value".
5) Restore the pref as the upgrade left it: `koha-mysql kohadev -e "INSERT INTO
systempreferences (variable, value, options, type) VALUES ('LimitReportsBy',
'none', 'none|library|library_group', 'Choice')"`, then run `restart_all`.
sysprefs.sql needs `('LimitReportsBy','none')` in place of
`('LimitReportsByLibrary','0')`.

Blocker 2: the renamed pref breaks check_sysprefs.t on upgraded sites
1) Run `koha-mysql kohadev -e "SELECT variable, value, options, type FROM
systempreferences WHERE variable = 'LimitReportsBy'"`. `options` is
`none|library|library_group` and `type` is `Choice`.
2) Temporarily fix blocker 1, so `check_sysprefs.t` gets past it: `sed -i
"s/('LimitReportsByLibrary','0')/('LimitReportsBy','none')/"
installer/data/mysql/mandatory/sysprefs.sql`
3) Run `prove t/db_dependent/check_sysprefs.t`. It fails with "LimitReportsBy
has 'options' set in DB, must be NULL!" and the same for 'type'.
4) Undo the temporary fix: `git checkout
installer/data/mysql/mandatory/sysprefs.sql`
Since Bug 41834, the atomic update must only rename `variable` and set `value`.

Blocker 3: the list and direct access disagree with nested groups
1) Open
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=LimitReportsBy,
set it to 'Library group' and click 'Save all Reports preferences'.
2) Open http://localhost:8081/cgi-bin/koha/admin/library_groups.pl, click 'New
group', title it 'Reports test', tick 'Limit report access by group' and save.
3) On 'Reports test', click 'Add library' and add Centerville.
4) On 'Reports test', click 'Actions' > 'Add sub-group' and create 'Sub'. On
'Sub', click 'Add library' and add Fairfield.
5) As koha, open
http://localhost:8081/cgi-bin/koha/reports/guided_reports.pl?op=add_form_sql
and save a report 'Limited to Fairfield' with SQL `SELECT 1`, selecting only
Fairfield in 'Library limitation'.
6) Do the same for a report 'Limited to Centerville', selecting only
Centerville.
7) Create a staff user at Centerville and one at Fairfield, each with only
'catalogue' and 'Reports' > 'execute_reports'.
8) Log in as the Centerville user and open
http://localhost:8081/cgi-bin/koha/reports/guided_reports.pl?op=list. 'Limited
to Fairfield' is listed, but clicking 'Run' gives "Access denied".
9) Log in as the Fairfield user and open the same list. 'Limited to
Centerville' isn't listed, but opening
http://localhost:8081/cgi-bin/koha/reports/guided_reports.pl?id=<its id>&op=run
runs it.

Should a group mean the whole tree under the root group where 'Limit report
access by group' is ticked, or only a library's immediate parent group?
Whichever it is, the list and direct access need to use the same rule.

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