MerginMaps / qgis-plugin

QGIS plugin for managing Mergin Maps projects
GNU General Public License v3.0
34 stars 13 forks source link

TypeError: argument of type 'NoneType' is not iterable #436

Open saberraz opened 2 years ago

saberraz commented 2 years ago

An error has occurred while executing Python code: TypeError: argument of type 'NoneType' is not iterable Traceback (most recent call last): File "C:\Users/USER/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Mergin\plugin.py", line 308, in current_project_sync self.manager.project_status(self.mergin_proj_dir) File "C:\Users/USER/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Mergin\projects_manager.py", line 163, in project_status validation_results = validator.run_checks() File "C:\Users/USER/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Mergin\validation.py", line 90, in run_checks self.check_value_relation() File "C:\Users/USER/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Mergin\validation.py", line 273, in check_value_relation self._check_primary_keys(child_layer, [idx]) File "C:\Users/USER/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Mergin\validation.py", line 285, in _check_primary_keys if layer_fields[i].name() in keys: TypeError: argument of type 'NoneType' is not iterable

saberraz commented 2 years ago

I have asked the user to share the project with me. I guess it something to do with Views.

stevenjh commented 1 year ago

Hi @saberraz I've just come across this issue in a project I'm working with.

I have implemented views into the gpkg to avoid using dynamic fields with aggregate logic to bring the 'last inspection' values onto the parent object. The number of aggregates I was implementing was causing significant delay in the opening/creating of the related inspection form.