gnucash stable: Bug 799701 - SX Editor error When Frequency=Once

Robert Fewell bobit at code.gnucash.org
Wed Dec 17 05:14:45 EST 2025


Updated	 via  https://github.com/Gnucash/gnucash/commit/92144137 (commit)
	from  https://github.com/Gnucash/gnucash/commit/34330c2a (commit)



commit 9214413732b1de77fbc4166ae81b78ba2f4c169b
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Wed Dec 10 11:07:24 2025 +0000

    Bug 799701 - SX Editor error When Frequency=Once
    
    When the frequency is once, in the SX edit frequency tab the scheduled
    date is not marked. This is due to the 'first_date' variable not being
    set and subsequent test for it being valid causing the calendar to be
    cleared.
    
    Add to the test for the recurrence type being 'once'.

diff --git a/gnucash/gnome/dialog-sx-editor.c b/gnucash/gnome/dialog-sx-editor.c
index 92fd507ec6..7d7e809862 100644
--- a/gnucash/gnome/dialog-sx-editor.c
+++ b/gnucash/gnome/dialog-sx-editor.c
@@ -1662,9 +1662,21 @@ gnc_sxed_update_cal (GncSxEditorDialog *sxed)
 
     if (!g_date_valid (&first_date))
     {
+        /* Note: There are no recurrences for PERIOD_NONE and on initial setting
+         * of PERIOD_WEEKLY (no days set), so still need to 'do nothing' */
+        gboolean do_nothing = TRUE;
+        if (recurrences)
+        {
+            Recurrence *r = g_list_nth_data (recurrences, 0);
+            if (r && r->ptype == PERIOD_ONCE)
+                do_nothing = FALSE;
+        }
         /* Nothing to do. */
-        gnc_dense_cal_store_clear (sxed->dense_cal_model);
-        goto cleanup;
+        if (do_nothing)
+        {
+            gnc_dense_cal_store_clear (sxed->dense_cal_model);
+            goto cleanup;
+        }
     }
 
     gnc_dense_cal_store_update_name (sxed->dense_cal_model, xaccSchedXactionGetName (sxed->sx));



Summary of changes:
 gnucash/gnome/dialog-sx-editor.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)



More information about the gnucash-changes mailing list