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 734029 - Saving a new resource twice creates a duplicate row
Saving a new resource twice creates a duplicate row
Status: RESOLVED FIXED
Product: gom
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Gom Maintainers
Gom Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-07-31 09:11 UTC by Jonathon Jongsma
Modified: 2014-08-05 11:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.02 KB, patch)
2014-07-31 09:11 UTC, Jonathon Jongsma
committed Details | Review

Description Jonathon Jongsma 2014-07-31 09:11:06 UTC
Created attachment 282128 [details] [review]
patch

If you create a new resource, call save(), change some properties, and then save() again, it will insert 2 rows.  It should UDPATE on the second save.  The attached patch should fix the issue, though I'm not sure if it's necessarily the right fix.
Comment 1 Bastien Nocera 2014-08-05 11:03:39 UTC
That looks correct indeed, thanks!
Comment 2 Bastien Nocera 2014-08-05 11:19:51 UTC
And verified with:

commit 143984b5a6529805272e937b965a9d9631835eb0
Author: Bastien Nocera <hadess@hadess.net>
Date:   Tue Aug 5 13:18:08 2014 +0200

    tests: Add test for previous commit
    
    Add test case for the double-INSERT, instead of INSERT followed by
    UPDATE, mentioned in
    https://bugzilla.gnome.org/show_bug.cgi?id=734029