 |
GeneralStonewall Magician
Joined: 02 Feb 2004 Posts: 364 Location: USA
|
Posted: Tue Jun 15, 2010 4:39 am
[3.19d] BUG: Database variable doesn't convert from 3.17 properly |
This variable does not convert to 3.19 properly:
3.17 XML:
Code: |
<var name="food" type="Record">cheese=%int(@calories * 0.33)|dessert=1|cherry_pie=%int(@calories*3/4)|utensil=fork|entrees=one,two</var> |
3.19d #VAR:
Quote: |
Variable: + food (Record) cheese=%int(@calories * 0.33)|dessert=1|cherry_pie=%int(@calories*3/4)|utensil=fork|entrees=one,two
json: {"cherry_pie":"%int(@calories*3\/4)","utensil":"fork","entrees":"one,two","dessert=1":null,"cheese=%int(@calories * 0.33)":null} (object) |
As you can see, "cheese=%int(@calories * 0.33)" and "dessert=1" are not being made into proper key:value pairs.
Here's another example of one that doesn't convert properly:
3.17 XML
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<var name="pipe_sets" type="Record" copy="yes">
<value>skullcap=2|elm=2|valerian=2</value>
<notes>Determines how many sets of each pipe to track.</notes>
</var>
</cmud>
|
3.19d #var
Code: |
Variable: + pipe_sets (Record) skullcap=2|valerian=2|elm=2
json: {"skullcap=2":null,"valerian=2":null,"elm=2":null} (object) |
|
|
|
 |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Jun 15, 2010 1:44 pm |
I can confirm the second problem. Any 3.17 database variable whose values are numbers (integers or decimals) will not be converted properly to json.
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Jun 15, 2010 5:16 pm |
Confirmed. Not sure what changed to cause this, but it's definitely a big problem. This will probably warrant another quick update later today. Thanks for the report.
|
|
|
 |
GeneralStonewall Magician
Joined: 02 Feb 2004 Posts: 364 Location: USA
|
Posted: Wed Jun 16, 2010 2:48 am |
It seems like this issue was a bit sticky to get rid of. After upgrading to 3.19e the variables that had already been converted incorrectly did not fix themselves. So I downgraded to 3.17 opened the package, saved it, and then upgraded to 3.19e; Same issue. I assume 3.17 didn't actually remove the json values despite not supporting them.
What I ended up having to do was the following: Downgrade to 3.17, export everything to xml, upgrade to 3.19e, and import. Alternatively, manually changing the trouble variables in 3.19e works as well. There should be no further problems after doing so.
Luckily this shouldn't be an issue for anyone but us beta testers that used the 3.18-3.19d versions. |
|
|
 |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Wed Jun 16, 2010 12:31 pm |
This is why Zugg asked us to keep backups of our stuff before upgrading to 3.18 and 3.19. The 3.17 backups are the only ones that will have undamaged versions of the data, if the data is damaged by the upgrade.
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Jun 16, 2010 4:40 pm |
Yep, sorry there wasn't any way to fix any variables that were corrupted by this bug in the previous version.
|
|
|
 |
GeneralStonewall Magician
Joined: 02 Feb 2004 Posts: 364 Location: USA
|
Posted: Wed Jun 16, 2010 7:34 pm |
Right, of course I had backups; I always do. I was just trying to find a procedure to fix the issue without resorting to them. I figured it'd be useful to somebody somewhere.
|
|
|
 |
|
|