From 9214413732b1de77fbc4166ae81b78ba2f4c169b Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Wed, 10 Dec 2025 11:07:24 +0000 Subject: [PATCH] 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'. --- gnucash/gnome/dialog-sx-editor.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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));