Open lbross opened 1 week ago
There are ways to get around this, but don't know that it's worth the effort to accommodate special characters in calculated variable names. Are you okay just supporting letters, numbers, and underscores? If so, we can add a filter to the textbox like we do with the additional harvest cost names.
Edit: Oops read this too quickly. It's in the description. We can look into escaping single quotes in a text string before saving it to the database. We will also need to make sure it looks right when it is displayed afterwards.
The process of creating the variable encompasses 3 tables. It's possible that the entry was made in one table but not all of them.
We can tell people not to use apostraphes or quotes but it does feel a bit like a straightjacket ;-)
There is a method in the SQLite data manager called FixString() that is intended to handle these cases. Hopefully this gives a good example on how we can fix this. Please check both the economic and fvs variable descriptions.
Calculated variable descriptions should now allow apostrophes for FVS and ECON variables. It doesn't look like double quotations was ever an issue. I tested adding variable and recalculating them, and I just pushed my code changes
From @jsfried: I used an apostrophe in my description of a calculated variable and got an error message in calculating that made me think that punctuation is a no-no. It seemed to complete normally after the error though, but did not display the new variable in the list of calculated variables. I went to remake it (and avoided punctuation) and it thew a dialog (OK the only choice) telling me that it was overriding existing calcs. So it must have been there but not visible. A little odd.