After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 509089 - QIF Import: Duplicates windows shown after Scheme error
QIF Import: Duplicates windows shown after Scheme error
Status: VERIFIED FIXED
Product: GnuCash
Classification: Other
Component: Import - QIF
2.2.x
Other All
: Normal trivial
: ---
Assigned To: Derek Atkins
Derek Atkins
Depends on:
Blocks: backport
 
 
Reported: 2008-01-13 06:13 UTC by Charles Day
Modified: 2018-06-29 21:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (26.20 KB, patch)
2008-02-01 04:19 UTC, Charles Day
none Details | Review
Screenshot of druid's new error page (27.04 KB, image/jpeg)
2008-02-01 04:24 UTC, Charles Day
  Details
Proposed patch v2 (commenting changes only) (26.20 KB, patch)
2008-02-04 22:02 UTC, Charles Day
committed Details | Review

Description Charles Day 2008-01-13 06:13:58 UTC
Please describe the problem:
If a Scheme error occurs when the druid calls the qif-to-gnc procedure, the user is taken to an empty duplicate checking window.

Steps to reproduce:
1. Cause a scheme error to occur during the qif-to-gnc procedure. For example, edit qif-to-gnc.scm and insert a bad expression such as (qwerty) in the code.
2. Attempt to import a QIF file that wouldn't normally cause an error.


Actual results:
The user is shown an error message ("An error occurred while importing...") but then taken to an empty (nonsensical) duplicate checking window.

Expected results:
The druid should quit and return the user to the GnuCash main window.

Does this happen every time?
Yes.

Other information:
Comment 1 Charles Day 2008-02-01 04:19:54 UTC
Created attachment 104160 [details] [review]
Proposed patch

Avoiding the duplicates window was trivial. Actually handling the error comprehensively required a lot more work. The existing functionality was that if an error occurred during conversion to GnuCash data structures, a pop-up warning would be shown, but no other action would be taken, and the user was free to go back/forward throughout the druid and retry with possibly corrupted data.

This patch includes the following changes:

In qif.glade:
1. Added an error page to the druid (see attached screenshot).
2. Added missing keyboard accelerators to three druid buttons ("Load another file", "Unload selected file", and "Select...")

druid-qif-import.c:
1. Reorganized and simplified the functions performing conversion and duplicate checking.
2. Centralized the code for choosing the next page after conversion (which had been duplicated in four separate places).
3. Replaced the pop-up error message with the druid's own error page that notifies the user and requires the import to be canceled.
4. Adjusted for consistent formatting within some functions.
5. Added or improved comments for some functions.
6. Fixed an inconsistent return value in get_prev_druid_page.
Comment 2 Charles Day 2008-02-01 04:24:05 UTC
Created attachment 104161 [details]
Screenshot of druid's new error page
Comment 3 Charles Day 2008-02-01 04:42:19 UTC
Since little mistakes in C can have big consequences (like crashing), I have tested this patch 'til I'm blue in the face. I can't break it. Anyone who'd like to test this further would have my sincere appreciation.
Comment 4 Charles Day 2008-02-04 22:02:25 UTC
Created attachment 104437 [details] [review]
Proposed patch v2 (commenting changes only)

This is the same as the first patch except for revisions to commenting style.
Comment 5 Charles Day 2008-03-03 17:18:50 UTC
Now that 2.2.4 is out of the way, does anyone have any comments for this patch before I commit it?
Comment 6 Charles Day 2008-03-14 03:26:26 UTC
Committed as r17031 with some additional commenting changes. Awaiting backport for 2.2.
Comment 7 Andreas Köhler 2008-04-20 19:35:36 UTC
Applied to branches/2.2 as r17098 for GnuCash 2.2.5.
Thanks a lot!
Comment 8 John Ralls 2018-06-29 21:59:11 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=509089. Please update any external references or bookmarks.