diff --git a/libgnucash/backend/sql/gnc-bill-term-sql.cpp b/libgnucash/backend/sql/gnc-bill-term-sql.cpp index f7c316e830..8d77b94940 100644 --- a/libgnucash/backend/sql/gnc-bill-term-sql.cpp +++ b/libgnucash/backend/sql/gnc-bill-term-sql.cpp @@ -98,7 +98,7 @@ static EntryVec col_table static EntryVec billterm_parent_col_table { - gnc_sql_make_table_entry("parent", 0, 0, nullptr, + gnc_sql_make_table_entry("parent", 0, 0, nullptr, bt_set_parent_guid), }; @@ -212,7 +212,7 @@ load_single_billterm (GncSqlBackend* sql_be, GncSqlRow& row, s.billterm = pBillTerm; s.have_guid = false; - gnc_sql_load_object (sql_be, row, GNC_ID_TAXTABLE, &s, + gnc_sql_load_object (sql_be, row, GNC_ID_BILLTERM, &s, billterm_parent_col_table); if (s.have_guid) l_billterms_needing_parents.push_back(new BillTermParentGuid(s)); diff --git a/libgnucash/backend/sql/gnc-owner-sql.cpp b/libgnucash/backend/sql/gnc-owner-sql.cpp index 25ebf7168f..443ab1a2fd 100644 --- a/libgnucash/backend/sql/gnc-owner-sql.cpp +++ b/libgnucash/backend/sql/gnc-owner-sql.cpp @@ -226,7 +226,7 @@ GncSqlColumnTableEntryImpl::add_to_query(QofIdTypeConst obj_name, buf.str(""); auto guid = qof_instance_get_guid(inst); if (guid != nullptr) - buf << guid; + buf << guid_to_string(guid); else buf << "NULL"; vec.emplace_back(std::make_pair(guid_hdr, buf.str())); diff --git a/libgnucash/backend/sql/gnc-slots-sql.cpp b/libgnucash/backend/sql/gnc-slots-sql.cpp index 694d453cab..2e8cee7256 100644 --- a/libgnucash/backend/sql/gnc-slots-sql.cpp +++ b/libgnucash/backend/sql/gnc-slots-sql.cpp @@ -889,7 +889,7 @@ load_slot_for_book_object (GncSqlBackend* sql_be, GncSqlRow& row, guid = load_obj_guid (sql_be, row); g_return_if_fail (guid != NULL); inst = lookup_fn (guid, sql_be->book()); - g_return_if_fail (inst != NULL); + if (inst == NULL) return; /* Silently bail if the guid isn't loaded yet. */ slot_info.be = sql_be; slot_info.pKvpFrame = qof_instance_get_slots (inst);