GNOME Bugzilla – Bug 571663
Wrong line selected in register with multiple splits in same account
Last modified: 2018-06-29 22:18:10 UTC
The patch I gave for bug 435642 isn't correct. It fails if you follow these steps: 1. create a transaction that has two or more splits in the same account 2. open a register on that account that is in either "Basic Ledger" or "Auto-Split Ledger" mode 3. change some transaction other than the one with multiple splits in this register 4. click on the second or succeeding occurrence of the transaction with multiple splits in this register This will put the cursor on the first occurrence of the transaction instead of the one you clicked on. If you are in auto-split mode it will also expand the one you really clicked on, but this is a separate bug. I'll attached a second try at a patch to fix this. I tested this one with all the combinations I could think of and it seems to work. I orignally attached this to bug 435642, but since that bug had been closed, no one noticed it was there.
Created attachment 128670 [details] [review] Patch to fix this problem This patch is slightly different from the one I attached to 435642. A "should not occur" else clause was changed to reset another switch. I've tested this version and it works as well as the other one.
Eek, I did not see this bug, because you did not write about it :-) I just wondered why bug 435642 affected two other bugs. Do you think the one-line addition should be applied as well? -- the lazy
It wouldn't hurt, but it shouldn't really matter. The calling sequence for gnc_split_register_find_split has both a split and a transaction that should contain the split. If the split isn't in the transaction but is in some other transaction appearing later in the register, then this change would cause gnc_split_register_find_split to return an error instead of the other transaction. It may not matter too much what it does in this case.
I'm trying to close this one up but I'm a bit confused. The patch attached to this bug only seems to have been "mostly" applied. What changes are left? Is it just one line?
Yes, the patch has been applied except for one line. I thought the patch had been missed since it was attached to a bug that had been closed and resubmitted it with this minor change, but the original version was applied. The original patch should be good enough. The change causes a different return in the case described in comment 3, but that case should not occur if the callers are calling this function correctly.
OK, I'll leave out the one line change then. From my reading of the code, it even might be better to leave it alone and return the location of the split, regardless of what transaction it belongs to. Closing this out. It seems easiest to just mark this as a duplicate of bug 435642 so that they stay tied together. *** This bug has been marked as a duplicate of 435642 ***
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=571663. Please update any external references or bookmarks.