Bug report #19607

Deactivating/uninstalling plugin causes Python error when trying to edit a Processing model

Added by Magnus Nilsson over 1 year ago. Updated about 1 year ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Processing/Modeller
Affected QGIS version:3.2.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:27434

Description

Hi
When I do these steps, I get a Pythin error:

1) Install a new plugin, such as QNEAT3
2) Create a simple processing model that uses this plugin
3) Deativate/uninstall the plugin
4) Try to edit the model

I don´t expect the model to run when the plugin is missing, but I would still like to be able to open and edit it. Perhaps QGIS, in the model window, could simply remove the plugin and give a hint to the user about the missing plugin? When I reactivate/install the plugin in again, I can edit the model.

The log:

Ett fel har inträffat vid Pythonexekvering:

AttributeError: 'NoneType' object has no attribute 'svgIconPath'
Traceback (most recent call last):
File "C:/PROGRA~1/QGIS3~1.2/apps/qgis/./python/plugins\processing\modeler\EditModelAction.py", line 44, in execute
dlg = ModelerDialog(alg)
File "C:/PROGRA~1/QGIS3~1.2/apps/qgis/./python/plugins\processing\modeler\ModelerDialog.py", line 403, in init
self.repaintModel()
File "C:/PROGRA~1/QGIS3~1.2/apps/qgis/./python/plugins\processing\modeler\ModelerDialog.py", line 661, in repaintModel
self.scene.paintModel(self.model, controls)
File "C:/PROGRA~1/QGIS3~1.2/apps/qgis/./python/plugins\processing\modeler\ModelerScene.py", line 120, in paintModel
item = ModelerGraphicItem(alg, model, controls, scene=self)
File "C:/PROGRA~1/QGIS3~1.2/apps/qgis/./python/plugins\processing\modeler\ModelerGraphicItem.py", line 78, in init
if element.algorithm().svgIconPath():
AttributeError: 'NoneType' object has no attribute 'svgIconPath'

Python version: 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)]
QGIS version: 3.2.1-Bonn Bonn, 1edf372fb8

Python sökväg:
C:/PROGRA~1/QGIS3~1.2/apps/qgis/./python
C:/Users/Magnus/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/Magnus/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS3~1.2/apps/qgis/./python/plugins
C:\Program Files\QGIS 3.2\bin\python36.zip
C:\PROGRA~1\QGIS3~1.2\apps\Python36\DLLs
C:\PROGRA~1\QGIS3~1.2\apps\Python36\lib
C:\Program Files\QGIS 3.2\bin
C:\PROGRA~1\QGIS3~1.2\apps\Python36
C:\PROGRA~1\QGIS3~1.2\apps\Python36\lib\site-packages
C:\PROGRA~1\QGIS3~1.2\apps\Python36\lib\site-packages\win32
C:\PROGRA~1\QGIS3~1.2\apps\Python36\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS3~1.2\apps\Python36\lib\site-packages\Pythonwin
C:/Users/Magnus/AppData/Roaming/QGIS/QGIS3\profiles\default/python

Associated revisions

Revision a86965e9
Added by Victor Olaya about 1 year ago

[processing] do not allow editing model if it's missing algorithms

fixes #19607

History

#1 Updated by Alexander Bruy over 1 year ago

  • Status changed from Open to Feedback
  • Operating System deleted (Windows 10 64 bit)

This is expected and correct behaviour. If plugin with 3rd party algorithms is not installed/desctivated, its algorithms also not available in the Processing. As result Processing simply don't know which inputs and outputs algorithm has and can't instantiate algorithm itself.

But it should not show traceback, a message warning user about missing algorithms should be shown instead and editing should be disbaled for such models.

#2 Updated by Magnus Nilsson over 1 year ago

I possible, I think QGIS should list the missing plugins used in the model and give the user a chance to install them and edit/run the model.

#3 Updated by Giovanni Manghi over 1 year ago

But it should not show traceback, a message warning user about missing algorithms should be shown instead and editing should be disbaled for such models.

moving to feature request?

#4 Updated by Olivier Dalang over 1 year ago

This happens too with user defined models.

If a parent model contains a child model, and a some point, the child model is removed, the parent model can't be edited anymore.

I think this should be considered a bug rather than a feature request, as it makes it very easy to destroy models in which users may have put a lot of work.

#5 Updated by Victor Olaya about 1 year ago

  • % Done changed from 0 to 100
  • Status changed from Feedback to Closed

Also available in: Atom PDF