r21577 - gnucash/trunk/src/backend/xml - Fix xml backend to load and save invoice kvp values.

Derek Atkins warlord at MIT.EDU
Fri Dec 9 09:53:15 EST 2011


Christian Stimming <christian at cstimming.de> writes:

> Am Donnerstag, 8. Dezember 2011, 07:12:37 schrieb John Ralls:
>> Actually, just checking for the existence of any keys starting with
>> "feature" in the Book's KVP and raising a GNC_BACKEND_TOO_NEW could be done
>> pretty quickly in both.
>
> Yes. However, I wonder how in the long run the error message could be
> slightly more helpful. As an error message should tell about features
> that are in the data file, but not yet known to the older program
> version trying to load the data file, such a feature list should
> contain at least one string that can be shown to the user. It will be
> english only (no translations), but at least the error message will
> say something like this:
>
>   "Cannot load the data file. It is from a newer version of gnucash and it 
> uses the feature "Invoices for a cup of coffee".  As the newer version of 
> gnucash has stored some data for this new feature, you cannot use the data 
> file with this older version anymore."
>
> Then, users wanting to avoid this error can go to the FAQ and/or gnucash-user 
> and ask how to avoid this particular feature in the newer gnucash, so that 
> they will still be able to use the file in older gnucash.

Sure.  So how about a KVP that looks like:

/features/
         name <string> = description


So, the 'features' subtree would only exist once there is a named
feature, so we can still look (in 2.4) for the existence of the
'features' subtree to decide whether to error out.  And the named
features' value would be the printable description which can be used for
the error message.  So in this case:

/features/credit-notes<string> = "Business Credit Notes"

> Regards,
>
> Christian

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-devel mailing list