roam-qgis / Roam

Simple data collection built using QGIS.
http://roam-docs.readthedocs.org/en/latest/
GNU General Public License v2.0
171 stars 61 forks source link

Expression - Simple value return field maxium+1 bug #405

Open Lendog opened 6 years ago

Lendog commented 6 years ago

the below simple value expression image

crashes roam form with image

In the expression string builder returns a sensible result image

bzeeb commented 6 years ago

Will investigate.

she-weeds commented 6 years ago

Hi, I'm experiencing the same issue in 2.6.0 as well; sensible output in expression editor but an error when adding new features. I get the same error when not wrapping "treeid" in to_int().

(Currently I'm using aggregate() which is probably what max_value() is based off, but it requires changing the layer name every time the form is used in a new project)

Error log: Something has gone wrong. Error: ValueError: invalid literal for int() with base 10: '[% to_int(maximum(to_int("treeid")))+1 %]' Traceback (most recent call last): File "roam\mainwindow.pyc", line 449, in openForm File "roam\dataentrywidget.pyc", line 178, in load_feature_form File "roam\dataentrywidget.pyc", line 78, in add_widget File "roam\editorwidgets\featureformwidget.pyc", line 178, in setvalue File "roam\editorwidgets\featureformwidget.pyc", line 134, in bind_values File "roam\api\featureform.pyc", line 513, in bindvalues File "roam\editorwidgets umberwidget.pyc", line 105, in setvalue ValueError: invalid literal for int() with base 10: '[% maximum(to_int("treeid"))+1 %]'