Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
qgib opened this issue Aug 13, 2018 · 5 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms

Comments

@qgib
Copy link
Contributor

qgib commented Aug 13, 2018

Author Name: Magnus Nilsson (Magnus Nilsson)
Original Redmine Issue: 19607
Affected QGIS version: 3.2.1
Redmine category:processing/modeller


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:/PROGRA1/QGIS31.2/apps/qgis/./python/plugins\processing\modeler\EditModelAction.py", line 44, in execute
dlg = ModelerDialog(alg)
File "C:/PROGRA1/QGIS31.2/apps/qgis/./python/plugins\processing\modeler\ModelerDialog.py", line 403, in init
self.repaintModel()
File "C:/PROGRA1/QGIS31.2/apps/qgis/./python/plugins\processing\modeler\ModelerDialog.py", line 661, in repaintModel
self.scene.paintModel(self.model, controls)
File "C:/PROGRA1/QGIS31.2/apps/qgis/./python/plugins\processing\modeler\ModelerScene.py", line 120, in paintModel
item = ModelerGraphicItem(alg, model, controls, scene=self)
File "C:/PROGRA1/QGIS31.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, 1edf372

Python sökväg:
C:/PROGRA1/QGIS31.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:/PROGRA1/QGIS31.2/apps/qgis/./python/plugins
C:\Program Files\QGIS 3.2\bin\python36.zip
C:\PROGRA1\QGIS31.2\apps\Python36\DLLs
C:\PROGRA1\QGIS31.2\apps\Python36\lib
C:\Program Files\QGIS 3.2\bin
C:\PROGRA1\QGIS31.2\apps\Python36
C:\PROGRA1\QGIS31.2\apps\Python36\lib\site-packages
C:\PROGRA1\QGIS31.2\apps\Python36\lib\site-packages\win32
C:\PROGRA1\QGIS31.2\apps\Python36\lib\site-packages\win32\lib
C:\PROGRA1\QGIS31.2\apps\Python36\lib\site-packages\Pythonwin
C:/Users/Magnus/AppData/Roaming/QGIS/QGIS3\profiles\default/python

@qgib
Copy link
Contributor Author

qgib commented Aug 26, 2018

Author Name: Alexander Bruy (@alexbruy)


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.


  • status_id was changed from Open to Feedback
  • operating_system was changed from Windows 10 64 bit to

@qgib
Copy link
Contributor Author

qgib commented Aug 27, 2018

Author Name: Magnus Nilsson (Magnus Nilsson)


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.

@qgib
Copy link
Contributor Author

qgib commented Aug 29, 2018

Author Name: Giovanni Manghi (@gioman)


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?

@qgib
Copy link
Contributor Author

qgib commented Sep 26, 2018

Author Name: Olivier Dalang (@olivierdalang)


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.

@qgib
Copy link
Contributor Author

qgib commented Jan 24, 2019

Author Name: Victor Olaya (@volaya)


Applied in changeset a86965e.


  • done_ratio was changed from 0 to 100
  • status_id was changed from Feedback to Closed

@qgib qgib closed this as completed Jan 24, 2019
@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
Development

No branches or pull requests

1 participant