Bug 29351 - Add missing cn_source parameter to reports parameter menu
Summary: Add missing cn_source parameter to reports parameter menu
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords: Manual
Depends on: 27644 29352 17600
Blocks:
  Show dependency treegraph
 
Reported: 2021-10-28 13:40 UTC by Owen Leonard
Modified: 2021-11-05 15:25 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
This patch adds a link for the previously-hidden option of using a runtime parameter for selecting "Source of classification or shelving scheme." Now when composing an SQL report you can click the "Insert runtime parameter" button to see a menu that includes this option.
Version(s) released in:
21.11.00


Attachments
Bug 29351: Add missing cn_source parameter to reports parameter menu (2.04 KB, patch)
2021-10-28 15:17 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 29351: Add missing cn_source parameter to reports parameter menu (2.14 KB, patch)
2021-10-28 17:45 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 29351: Add missing cn_source parameter to reports parameter menu (3.06 KB, patch)
2021-10-31 00:20 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2021-10-28 13:40:07 UTC
There has always been a cn_source ("Source of classification or shelving scheme") runtime parameter available to SQL reports, although it isn't mentioned in the wiki.
Comment 1 Andrew Fuerste-Henry 2021-10-28 14:38:18 UTC
I didn't know this was an option! Good catch!
Comment 2 Owen Leonard 2021-10-28 15:17:51 UTC
Created attachment 127063 [details] [review]
Bug 29351: Add missing cn_source parameter to reports parameter menu

This patch adds an option to insert "Source of classification or
shelving scheme" as a runtime parameter in SQL reports. The ability to
use cn_source as a parameter seems to have always been part of this
feature but wasn't documented.

To test, apply the patch and go to Reports -> Create from SQL.

 - Click the "Insert runtime parameter" button and select
   "Classification source."
 - Customize the parameter label if you wish and click "Insert
   parameter."
 - The parameter should be inserted like this:

   <<Source of classification or shelving scheme|cn_source>>

 - Use it to create a valid SQL report, for example:

   SELECT * FROM items WHERE cn_source = <<Source of classification or
   shelving scheme|cn_source>> LIMIT 10

 - Confirm that upon running the report you are prompted to select a
   classification source.
 - Confirm that the report runs correctly.
Comment 3 Andrew Fuerste-Henry 2021-10-28 17:07:30 UTC
I'm getting this error when trying to run my report: 
Undefined subroutine &CGI::Compile::ROOT::kohadevbox_koha_reports_guided_reports_2epl::GetClassSources called at /kohadevbox/koha/reports/guided_reports.pl line 761
Comment 4 Owen Leonard 2021-10-28 17:35:23 UTC
Sorry, I should have put this in the test plan: There is a followup on Bug 17600 which is required for GetClassSources to work: See comment 148 on that bug.
Comment 5 Andrew Fuerste-Henry 2021-10-28 17:45:19 UTC
Created attachment 127069 [details] [review]
Bug 29351: Add missing cn_source parameter to reports parameter menu

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 6 Andrew Fuerste-Henry 2021-10-28 17:46:07 UTC
Thanks! I Was able to test successfully after I applied your patch from 17600.
Comment 7 Katrin Fischer 2021-10-31 00:20:57 UTC
Created attachment 127116 [details] [review]
Bug 29351: Add missing cn_source parameter to reports parameter menu

This patch adds an option to insert "Source of classification or
shelving scheme" as a runtime parameter in SQL reports. The ability to
use cn_source as a parameter seems to have always been part of this
feature but wasn't documented.

To test, apply the patch and go to Reports -> Create from SQL.

 - Click the "Insert runtime parameter" button and select
   "Classification source."
 - Customize the parameter label if you wish and click "Insert
   parameter."
 - The parameter should be inserted like this:

   <<Source of classification or shelving scheme|cn_source>>

 - Use it to create a valid SQL report, for example:

   SELECT * FROM items WHERE cn_source = <<Source of classification or
   shelving scheme|cn_source>> LIMIT 10

 - Confirm that upon running the report you are prompted to select a
   classification source.
 - Confirm that the report runs correctly.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Jonathan Druart 2021-11-02 15:54:35 UTC
Pushed to master for 21.11, thanks to everybody involved!