Bug 24773 - Report spacing incorrect on import from Mana
Summary: Report spacing incorrect on import from Mana
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Mana-kb (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-02 03:49 UTC by Andrew Fuerste-Henry
Modified: 2020-04-02 00:36 UTC (History)
4 users (show)

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


Attachments
Importing report with Mana (220.66 KB, image/png)
2020-03-10 00:13 UTC, Kelly McElligott
Details
spacing in a report (161.33 KB, image/png)
2020-04-02 00:36 UTC, Kelly McElligott
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2020-03-02 03:49:19 UTC
When importing a report from Mana, there are missing whitespaces that break the query. I'm not certain whether the spaces are lost when the report comes into mana or when the report comes down to Koha. It might be dropping newlines? Whatever the details, the reports require an amount of correction after download that is prohibitive for some users.
Comment 1 Andrew Fuerste-Henry 2020-03-02 03:50:26 UTC
I'm not entirely clear whether this is something I should be filing here or entering as an issue on Mana on Git.
Comment 2 Jonathan Druart 2020-03-09 14:55:33 UTC
Which report, do you have an example?
Comment 3 Kelly McElligott 2020-03-10 00:12:35 UTC
Hi Jonathan,
I can give you examples; this one was uploaded 4/27/2017 and named "All Orders" - I am pasting the sql that gets imported into the report box:



select v.name as Vendor, concat(c.basketname, ' (', c.basketno, ')') as Basket,       c.creationdate as Ordered,  concat(p.firstname, ' ',       p.surname) as 'Managed by', b.title,       ExtractValue(bi.marcxml, '//datafield[@tag="245"]/subfield[@code="b"]') as subtitle,       b.author, bi.isbn, bi.publishercode,       o.rrp as RRP, o.ecost as EST, o.quantity as Qty,       format(o.listprice*o.quantity,2) as Total, f.budget_name as Fundfrom aqorders oleft join aqbudgets f using (budget_id)left join biblio b using (biblionumber)left join biblioitems bi using (biblionumber)left join aqbasket c using (basketno)left join aqbooksellers v on (c.booksellerid=v.id)left join borrowers p on (c.authorisedby=p.borrowernumber)order by v.name, c.basketno asc

As you can see there are odd spaces, and letters are joined to words, for example ojoin in line 6 .  The from is usually the hardest to find as it will be merged with the word right before it in the sql. 

I will also attach a screenshot.
Comment 4 Kelly McElligott 2020-03-10 00:13:00 UTC
Created attachment 100415 [details]
Importing report with Mana
Comment 5 Jonathan Druart 2020-03-11 15:09:28 UTC
Hi Kelly,

I contacted Alex (@biblibre) who has access to the mana server.

This report (id=254 for the record) is incorrect in the DB of the server, new lines have been deleted.
It seems that something went wrong during the import.

We also found other weirdnesses, like values not in the correct field - https://snipboard.io/UwKyYq.jpg

He will have a look during the (no)hackfest week and get back to us :)
Comment 6 Alex Arnaud 2020-03-27 11:20:54 UTC
Hello,

Borken reports in Mana came from bad formatted CSV file.

I removed all of this reports from DB, clear all related CSV and imported them agsin.

deleted 1719 reports
re-imported 977

The difference is due to the bad formatted report i've removed from CSV. And one CSV (656 lines )i could not fix.
Comment 7 Jonathan Druart 2020-04-01 14:22:31 UTC
Alex, does it mean we can close this bug report?
Comment 8 Kelly McElligott 2020-04-02 00:35:30 UTC
Hi, I do see that there are newly imported reports in Mana as of 3/27/2020.  I attempted to import two of these newer reports, and the spacing appears to still be an issue.  I have attached a screenshot.
Comment 9 Kelly McElligott 2020-04-02 00:36:09 UTC
Created attachment 102254 [details]
spacing in a report