gisquick / gisquick-qgis-plugin-old

DEPRECATED Gisquick QGIS Plugin - tool for publishing QGIS projects in Gisquick platform
http://gisquick.readthedocs.io
GNU General Public License v3.0
6 stars 4 forks source link

AttributeError: 'NoneType' #19

Open shapley opened 3 years ago

shapley commented 3 years ago

Hi,

Been using the gisquick plugin and all has worked well but when I created a new QGIS project recently when I clicked on the 'gisquick plugin' then moving from 'Base layer' > 'next' the following error appears:-

An error has occurred while executing Python code:

AttributeError: 'NoneType' object has no attribute 'mapUnitsToLayoutUnits' Traceback (most recent call last): File "/home/paul/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/gisquick-qgis-plugin/project.py", line 291, in validate self.get_metadata() File "/home/paul/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/gisquick-qgis-plugin/project.py", line 1133, in get_metadata units_conversion = map.mapUnitsToLayoutUnits() AttributeError: 'NoneType' object has no attribute 'mapUnitsToLayoutUnits'

Python version: 3.7.4 (default, Nov 10 2011, 15:00:00) [GCC 9.2.0] QGIS version: 3.12.3-București București, 82342615

Python Path: /app/share/qgis/python /home/paul/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python /home/paul/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins /app/share/qgis/python/plugins /usr/lib/python37.zip /usr/lib/python3.7 /usr/lib/python3.7/lib-dynload /usr/lib/python3.7/site-packages /app/lib/python3.7/site-packages /app/lib/python3.7/site-packages/numpy-1.14.3-py3.7-linux-x86_64.egg /app/lib/python3.7/site-packages/MarkupSafe-1.0-py3.7-linux-x86_64.egg /home/paul/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python /home/paul/Desktop/My Desktop Stuff/gisquick

No idea why it won't now work on any project anymore. I'm using QGIS 3.12.3 on Ubuntu 20.04 LTS 64 bit.

Many thanks,

marcel-dancak commented 3 years ago

Hi, from this traceback it looks like you have a print layout in your project, but without a map element. And right now, plugin doesn't expect such situation. If there is a valid use case for such layouts, then plugin could ignore them, but right now I'm not sure. I will let this issue opened for further discussion.

shapley commented 3 years ago

many thanks marcel...

On Tue, 23 Feb 2021 at 21:28, marcel-dancak notifications@github.com wrote:

Hi, from this traceback it looks like you have a print layout in your project, but without a map element. And right now, plugin doesn't expect such situation. If there is a valid use case for such layouts, then plugin could ignore them, but right now I'm not sure. I will let this issue opened for further discussion.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gislab-npo/gisquick/issues/112#issuecomment-784524782, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVSSJNO4CIGW5VP2K76PC3TAQMW3ANCNFSM4YAUHAKQ .

-- Paul J. Shapley MSc CGeog (GIS) FRGS

shapley commented 3 years ago

I can confirm that there is no missing map element. I've tried some variations such as removing all layers and adding them back in one-by-one, nothing is allowing me to move from this error even re-installed the plugin. I would like this to work. How do i go about getting some development time for it to work?

Python Error:

2021-02-24T14:16:02 WARNING Traceback (most recent call last): File "/home/paul/.local/share/QGIS/QGIS3/profiles/default/python/plugins/gisquick-qgis-plugin/project.py", line 291, in validate self.get_metadata() File "/home/paul/.local/share/QGIS/QGIS3/profiles/default/python/plugins/gisquick-qgis-plugin/project.py", line 1133, in get_metadata units_conversion = map.mapUnitsToLayoutUnits() AttributeError: 'NoneType' object has no attribute 'mapUnitsToLayoutUnits'

marcel-dancak commented 3 years ago

It doesn't look like problem with layers, but with print layouts in your project. If you open your project in QGIS, you can try to run this code in Python Console (Plugins menu) to get more info.

project = QgsProject.instance()
pm = project.layoutManager()
[[layout.name(), layout.referenceMap()] for layout in pm.layouts()]