roam-qgis / Roam

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

Inspection mode layers crash with Error: TypeError: 'dict_values' object does not support indexing #471

Open minguo33 opened 3 years ago

minguo33 commented 3 years ago

Using Beta v 3, tested with multiple data and layer types.

When using config if setting the 'Inspection' check box under the layer entry in 'Select Layers' to true it throws this error:

Traceback (most recent call last): File "C:\Users\Nathan\dev\Roam\src\configmanager\ui\configmanagerdialog.py", line 178, in nodeselected File "C:\Users\Nathan\dev\Roam\src\configmanager\ui\projectwidget.py", line 153, in setpage File "C:\Users\Nathan\dev\Roam\src\configmanager\ui\layerwidgets.py", line 1120, in set_project File "C:\Users\Nathan\dev\Roam\src\roam\project.py", line 421, in layer_tools TypeError: 'dict_values' object does not support indexing

When using Roam and selecting a feature of an inspection layer, Roam throws this error:

Traceback (most recent call last): File "C:\Users\Nathan\dev\Roam\src\roam\infodock.py", line 366, in layerIndexChanged File "C:\Users\Nathan\dev\Roam\src\roam\infodock.py", line 466, in update File "C:\Users\Nathan\dev\Roam\src\roam\project.py", line 421, in layer_tools TypeError: 'dict_values' object does not support indexing

When continuing to Data Entry it throws another error;

Traceback (most recent call last): File "C:\Users\Nathan\dev\Roam\src\roam\mapwidget.py", line 694, in queue_feature_for_edit File "C:\Users\Nathan\dev\Roam\src\roam\mapwidget.py", line 946, in load_form AttributeError: 'NoneType' object has no attribute 'icon'

and the Form never appears.

If you go back to config all the check boxes under the 'select layer' for the inspection layer are now unchecked.

Google searching the error suggests a Python3 incompatibility

https://stackoverflow.com/questions/17431638/get-typeerror-dict-values-object-does-not-support-indexing-when-using-python

minguo33 commented 1 year ago

Issue still present in 3.0.6

The first error is still thrown in config manager.

Traceback (most recent call last): File "C:\Users\Nathan\dev\Roam\src\configmanager\ui\configmanagerdialog.py", line 178, in nodeselected File "C:\Users\Nathan\dev\Roam\src\configmanager\ui\projectwidget.py", line 153, in setpage File "C:\Users\Nathan\dev\Roam\src\configmanager\ui\layerwidgets.py", line 1120, in set_project File "C:\Users\Nathan\dev\Roam\src\roam\project.py", line 421, in layer_tools TypeError: 'dict_values' object does not support indexing

But after saving, the project will not load in Roam.

minguo33 commented 1 year ago

Ok, so this appears to only be an issue with the binary 3.0.6 release.

I swapped out the project.pyc in lib/roam folder the from the release with the project.py from the master source and it worked without issue.

So easily resolved with a repackaging of release I assume.