Bug 27824 - Report batch operations break with space in placeholder
Summary: Report batch operations break with space in placeholder
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on: 23390
Blocks:
  Show dependency treegraph
 
Reported: 2021-03-01 16:12 UTC by Owen Leonard
Modified: 2023-12-28 20:47 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.02,22.11.08


Attachments
Bug 27824: Add a test (1.47 KB, patch)
2023-07-05 13:45 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 27824: Trim column headers (1.45 KB, patch)
2023-07-05 13:45 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 27824: Add a test (1.51 KB, patch)
2023-07-05 15:49 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 27824: Trim column headers (1.50 KB, patch)
2023-07-05 15:49 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 27824: Add a test (1.57 KB, patch)
2023-07-09 14:15 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 27824: Trim column headers (1.56 KB, patch)
2023-07-09 14:15 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-03-01 16:12:16 UTC
I found this bug while testing Bug 5697:

Using the system for defining a column name placeholder (Bug 23390), if there is a space inside the column name placeholder it won't work. The SQL example in Bug 5697:

SELECT 
i.itemnumber,
i.itemnumber as Exemplarnummber,
[[i.itemnumber| itemnumber for batch]],
CONCAT('<a href=\"/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=', i.biblionumber, '&itemnumber=', i.itemnumber, '#edititem', '\">', i.itemnumber, '</a>' ) AS "itemnumber as edit link"
FROM items i

"[[i.itemnumber| itemnumber for batch]]" has a space before "itemnumber for batch." With that space removed it works as expected.
Comment 1 Jonathan Druart 2021-03-02 14:09:02 UTC
What does not work exactly?
I copy/pasted the query to create a new SQL report, I run it and see the table result with the 4 headers: itemnumber, Exemplarnummber,	itemnumber for batch, itemnumber as edit link
Comment 2 Katrin Fischer 2023-07-01 17:34:24 UTC
(In reply to Jonathan Druart from comment #1)
> What does not work exactly?
> I copy/pasted the query to create a new SQL report, I run it and see the
> table result with the 4 headers: itemnumber, Exemplarnummber,	itemnumber for
> batch, itemnumber as edit link

The third column should look like the first - linked to actions. But it doesn't work.
Comment 3 Jonathan Druart 2023-07-05 13:45:36 UTC
Created attachment 153059 [details] [review]
Bug 27824: Add a test
Comment 4 Jonathan Druart 2023-07-05 13:45:39 UTC
Created attachment 153060 [details] [review]
Bug 27824: Trim column headers

To support additional spaces.

Using the system for defining a column name placeholder (Bug 23390), if there is a space inside the column name placeholder it won't work. The SQL example in Bug 5697:

SELECT
i.itemnumber,
i.itemnumber as Exemplarnummber,
[[i.itemnumber| itemnumber for batch]],
CONCAT('<a href=\"/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=', i.biblionumber, '&itemnumber=', i.itemnumber, '#edititem', '\">', i.itemnumber, '</a>' ) AS "itemnumber as edit link"
FROM items i

"[[i.itemnumber| itemnumber for batch]]" has a space before "itemnumber for batch." With that space removed it works as expected.
Comment 5 Owen Leonard 2023-07-05 15:49:27 UTC
Created attachment 153064 [details] [review]
Bug 27824: Add a test

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 6 Owen Leonard 2023-07-05 15:49:29 UTC
Created attachment 153065 [details] [review]
Bug 27824: Trim column headers

To support additional spaces.

Using the system for defining a column name placeholder (Bug 23390), if
there is a space inside the column name placeholder it won't work. The
SQL example in Bug 5697:

SELECT
i.itemnumber,
i.itemnumber as Exemplarnummber,
[[i.itemnumber| itemnumber for batch]],
CONCAT('<a
href=\"/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=',
i.biblionumber, '&itemnumber=', i.itemnumber, '#edititem', '\">',
i.itemnumber, '</a>' ) AS "itemnumber as edit link"
FROM items i

"[[i.itemnumber| itemnumber for batch]]" has a space before "itemnumber
for batch." With that space removed it works as expected.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 7 Katrin Fischer 2023-07-09 14:15:11 UTC
Created attachment 153220 [details] [review]
Bug 27824: Add a test

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Katrin Fischer 2023-07-09 14:15:14 UTC
Created attachment 153221 [details] [review]
Bug 27824: Trim column headers

To support additional spaces.

Using the system for defining a column name placeholder (Bug 23390), if
there is a space inside the column name placeholder it won't work. The
SQL example in Bug 5697:

SELECT
i.itemnumber,
i.itemnumber as Exemplarnummber,
[[i.itemnumber| itemnumber for batch]],
CONCAT('<a
href=\"/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=',
i.biblionumber, '&itemnumber=', i.itemnumber, '#edititem', '\">',
i.itemnumber, '</a>' ) AS "itemnumber as edit link"
FROM items i

"[[i.itemnumber| itemnumber for batch]]" has a space before "itemnumber
for batch." With that space removed it works as expected.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Tomás Cohen Arazi 2023-07-13 18:21:17 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 10 Martin Renvoize 2023-07-18 11:51:53 UTC
Thanks for all the hard work!

Pushed to 23.05.x for the next release
Comment 11 Matt Blenkinsop 2023-07-18 14:23:38 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x