Bug 403068 - Storing and loading customized information reports in XML is totally broken
Summary: Storing and loading customized information reports in XML is totally broken
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: reports (show other bugs)
Version: 5.0.2
Platform: Other Linux
: HI critical
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-10 12:03 UTC by Nick Elliott
Modified: 2019-05-05 17:04 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.0.3
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Elliott 2019-01-10 12:03:40 UTC
SUMMARY

This only happens with one custom report which I've used in the past. It looks like all the other reports, both standard and customised, are unaffected.

I don't think I've used this report since upgrading to KMyM V5. I recently reorganised some Categories but other than that I've been using the software as normal.

I get this error message:
ObjectInfoTable::ObjectInfoTable(): unhandled row type in file /build/kmymoney-8Tb1zm/kmymoney-5.0.1/kmymoney/reports/objectinfotable.cpp line 115

SOFTWARE/OS VERSIONS
Linux Kernel Version: 4.15.0-43-generic
KDE Plasma Version: 5.12.7
KDE Frameworks Version: 5.44.0
Qt Version: 5.9.5
Comment 1 Thomas Baumgart 2019-01-11 07:53:33 UTC
This message can only happen, when the object type of the report is not supported. The code is identical to the 4.8 branch at this point, so I don't know how you ended up with this.

Please try the following: Extract all report configurations from your data file (let's call it nick.kmy for example). Select the one of the failing report and add it to the bug-entry (please feel free to replace any alpha that you don't want to store here with X or any other letter).

  zcat nick.kmy | grep REPORT

will show you the configuration of all reports. If you have some 'text' that is unique in that report, you can extract that with

  zcat nick.kmy | grep REPORT | grep 'text'
Comment 2 Nick Elliott 2019-01-11 09:22:32 UTC
I've identified one other report that also cause the crash. They are both customised Information reports. Here are the configurations from my data file:

  <REPORT comment="Worksheet for Financial Advisor Review Meeting" showrowtotals="0" convertcurrency="0" group="Information" skipZero="0" type="infotable 1.0" favorite="1" id="R000021" datelock="today" name="* Annual Review - Summary of Investments &amp; Savings">
  </REPORT>

  <REPORT comment="" showrowtotals="0" convertcurrency="0" group="Information" skipZero="0" type="infotable 1.0" favorite="0" id="R000028" datelock="today" name="* Current non-ISA Savings Accounts">
  </REPORT>
Comment 3 Thomas Baumgart 2019-01-11 13:55:32 UTC
The whole logic to store and load customized information reports is broken. It crashes here because of a missing rowType attribute but that is not all. There is more to it which I need to analyze and clean up.

I have not checked how this looks like with the SQL storage backend. Could be broken as well.
Comment 4 Nick Elliott 2019-01-11 14:36:46 UTC
Thank you for the update.
Comment 5 Thomas Baumgart 2019-01-13 08:16:11 UTC
Git commit 3939181ec1ce65de5c13867e73e119cbcefca8b7 by Thomas Baumgart.
Committed on 13/01/2019 at 08:17.
Pushed by tbaumgart into branch '5.0'.

Fix customized report loading and saving

The storage of the accountgroup information for customized reports was
broken due to a mis-assignment between numeric and textual
representation. This was introduced with
https://phabricator.kde.org/D13581 which landed as commit
b7c44b7f705cd8.

With the current change, the account group information will be
reconstructed during loading of the file depending on the report type
and the above mentioned assignment problem will be fixed.

Also, the report type was not written for any customized information
report which caused a crash during usage after the next start of the
application. Since the report type cannot be detected automatically from
the available data in broken files, the type will be set to AccountInfo.

A respective message is dumped to the console. Users may have to
redesign their loan, schedule and schedule summary reports. The problem
shows, if a user opens such a report and it now displays an account
information report. Nevertheless, the original report filter settings
are loaded correctly.

All other report types are not affected by this problem.
FIXED-IN: 5.0.3

M  +1    -0    kmymoney/mymoney/mymoneyenums.h
M  +66   -49   kmymoney/mymoney/mymoneyreport.cpp
M  +22   -15   kmymoney/mymoney/mymoneyreport.h
M  +8    -2    kmymoney/plugins/views/reports/core/objectinfotable.cpp
M  +86   -80   kmymoney/plugins/xmlhelper/xmlstoragehelper.cpp

https://commits.kde.org/kmymoney/3939181ec1ce65de5c13867e73e119cbcefca8b7
Comment 6 Thomas Baumgart 2019-05-05 17:04:33 UTC
*** Bug 407072 has been marked as a duplicate of this bug. ***