gnucash stable: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Fri Oct 9 19:22:02 EDT 2026


Updated	 via  https://github.com/Gnucash/gnucash/commit/b183b507 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/5d5cd0b7 (commit)
	from  https://github.com/Gnucash/gnucash/commit/24e7b3ae (commit)



commit b183b507f2db984875d83d31992b2a805f74caea
Merge: 24e7b3ae75 5d5cd0b758
Author: John Ralls <jralls at ceridwen.us>
Date:   Fri Oct 9 16:20:24 2026 -0700

    Merge Noah Noerr's 'price-set-source-string-warn' into stable.

commit 5d5cd0b7586ab9980c08f031a03c250726f227cd
Author: Noerr <Noerr at users.noreply.github.com>
Date:   Wed Sep 23 02:06:16 2026 -0700

    [engine] gnc_price_set_source_string: warn on an unknown source string
    
    The setter maps a fixed set of canonical strings (source_names) to the
    PriceSource enum. On any other string it fell through the loop and returned
    having changed nothing -- silently -- so callers on the XML and SQL load paths,
    the GUI price editor, and (until deprecated) the bindings got no indication that
    the source was dropped. Emit a PWARN so an unrecognized source string is at least
    visible in the log instead of vanishing.
    
    Kept at WARNING rather than CRITICAL: this setter is primarily a deserialization
    helper fed stored data, so an unrecognized string is unexpected external data,
    not a broken precondition. A garbage source in a SQL backend -- for which there
    is no repair path -- should not log a CRITICAL on every open; the price still
    loads and only its source label degrades to PRICE_SOURCE_INVALID.
    
    "invalid", the string form of PRICE_SOURCE_INVALID, reaches this fall-through as
    well. INVALID is only the loop sentinel, never a settable source, so it is warned
    uniformly like any other non-settable string. This is a real, non-corrupt case:
    the random-price test generator and existing books both hold PRICE_SOURCE_INVALID
    prices that serialize as "invalid" and round-trip back through here.
    
    The warning names the offending price -- commodity namespace:mnemonic -> currency
    mnemonic and its date -- so a user who finds it in the trace log has enough to
    locate the price in the price editor and correct or remove it. The commodity,
    currency and date are already populated when the source is set on both load
    paths (the SQL col_table and the XML element order both place source last).



Summary of changes:
 libgnucash/engine/gnc-pricedb.cpp | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)



More information about the gnucash-patches mailing list