FieldStudiesCouncil / QGIS-Biological-Recording-Tools

QGIS plugin for biological recorders. Created with the FSC Tomorrow's Biodiversity project.
GNU General Public License v3.0
10 stars 4 forks source link

Error in add_grid_ref_provider.py when setting default CRS: QGIS 3.6.1/tombio 3.2.1 #37

Closed potsherd closed 5 years ago

potsherd commented 5 years ago

I have used the tombio plugin for a while on QGIS 2.18 (on kubuntu linux) with no problems. I am now testing QGIS 3.6.1 with Tombio 3.2.1. When changing the default CRS for new projects in Settings->Options->CRS it throws this error:

An error has occurred while executing Python code:

RuntimeError: wrapped C/C++ object of type AddGridRefAlgorithm has been deleted Traceback (most recent call last): File "/home/paul/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/TomBio/add_grid_ref_provider.py", line 57, in loadAlgorithms self.addAlgorithm( alg ) RuntimeError: wrapped C/C++ object of type AddGridRefAlgorithm has been deleted

Python version: 3.7.2 (default, Nov 10 2011, 15:00:00) [GCC 8.3.0] QGIS version: 3.6.1-Noosa Noosa, 93e761dd

Thinking this might be a peculiarly linux problem I did a fresh install on Windows 10 with qgis 3.6.1 from QGIS-OSGeo4W-3.6.1-1-Setup-x86_64.exe on the qgis download page, and the same version of tombio and got the same error on the line 57 in add_grid_ref_provider.py.

Any thoughts?

Paul

burkmarr commented 5 years ago

Thanks for letting us know. I shall take a look some time this week and get back to you.

burkmarr commented 5 years ago

The error was generated by the add_grid_ref_algorithm.py file which is part of the new 'Add Grid Ref' tool which conforms to the QGIS processing framework. For some reashon the 'loadAlgorithms' method gets called when the user resets the QGIS default CRS as described in the bug report. I found it necessary to regenerate the actual processing algorithm at this point to prevent the crash. This had previously been done in the init function of the class, so I moved it into the loadAlgorithms method. This will be included in the next maintenance release of the plugin. I'm awaiting some communication from NBN on a separate problem before making that release.

burkmarr commented 5 years ago

Published with release 3.2.2.

potsherd commented 5 years ago

Many thanks. Working OK here on windows and linux.