Is missing trn:currency clause legal?

Derek Atkins warlord at MIT.EDU
Mon Feb 22 16:21:40 EST 2010


Donald Allen <donaldcallen at> writes:

> So here's my question: is the transaction without a <trn:currency>
> clause mal-formed? 

Yes, it is mal-formed.

>     If it is mal-formed, then more work is needed,
> because the current version produces such transactions under certain
> circumstances: it did so when I *modified* the transaction from 4
> years ago and I don't think my deletion-reentering experiment proves
> that it's not going to do this with a new transaction, since my newly
> entered transaction and the one four years ago were certainly entered
> with different UI gestures, so I think it's possible that whatever
> caused this 4 years ago could still be lurking in the code.

This is not actually true.  The currency is only touched at transaction
creation time.  It is not retouched later.  SO the fact that you
modified a 4-year-old transaction has no bearing on the issue.
Modifying it will not reset the currency.

> And regardless of whether it is mal-formed or not, the sql backend
> needs to do a better job of dealing with this situation -- it
> currently fails silently. You only find out that this has occurred
> when you restart gnucash and your numbers are bogus. I will work with
> Phil when he returns in March to fix this (I don't know enough about
> the gnucash environment to do better error notification through the
> GUI  time-efficiently myself).

Agreed, it should be more vocal about failures!  In particular it should
at LEAST output something to gnucash.trace!

> BTW, I should note that mal-formed or not, this transaction caused no
> trouble with the stable versions of gnucash to-date (certainly there
> have been no complaints about the validity of the xml file). I should
> also note, for the record, that my gnucash file has never been written
> to by anything other than gnucash.

This is just luck, and the fact that the xml data processor is more
forgiving of errors.

Can you try to run a Check & Repair to see if it fixes the issue?

> /Don

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

More information about the gnucash-devel mailing list