Skip to content
This repository has been archived by the owner on Jun 4, 2020. It is now read-only.

Uncaught AttributeError: 'NoneType' object has no attribute 'source' #51

Closed
peter-shr opened this issue Nov 21, 2016 · 7 comments
Closed

Comments

@peter-shr
Copy link

Steps to reproduce

  1. First
  2. Second
  3. Third
Traceback (most recent call last):
  File "C:/Users/user/.qgis2/python/plugins\qgis_versioning\versioning.py", line 187, in on_legend_click
    uri = QgsDataSourceURI(layer.source())
AttributeError: 'NoneType' object has no attribute 'source'

qgis_versioning 0.4, QGIS 2.14.8-Essen on Windows 10

@ar-jan
Copy link

ar-jan commented Apr 4, 2017

I get a similar probem (Windows 7, QGIS 2.18.5, qgis-versioning 0.6, PostgreSQL 9.6, PostGIS 2.3). Same cause? Any clues what's wrong?

Traceback (most recent call last):
File "C:/Users/arjan/.qgis2/python/plugins\qgis_versioning\versioning.py", line 848, in historize
versioning_base.historize( self.pg_conn_info(), schema )
File "C:/Users/arjan/.qgis2/python/plugins\qgis_versioning\versioning.py", line 189, in pg_conn_info
if layer.providerType() == "postgres":
AttributeError: 'TileLayer' object has no attribute 'providerType'

@gignacnic
Copy link
Contributor

What type of layers you have in the group layer in QGIS you are versioning (printscreen)? It seems that you have combined in the group, layers that are not postgres and it seems to be either a: TileLayer (#51 (comment)) or a source that did not open successfully (#51 (comment))...

@ar-jan
Copy link

ar-jan commented Apr 4, 2017

Hmm, interesting. So I had created a normal group in the Layers Panel (Add Group), then added just one PostGIS layer to this group.

I now created a new project and did the same thing, and the "historize" action worked correctly. The only difference is that in my earlier project, there were also other groups with layers in them when I first tried, but I had selected the one with only the PostGIS layer.

I'll see if I can get it to work in the existing project as well. Thanks!

@gignacnic
Copy link
Contributor

Yes, you need to have a group layer that includes only the layers that you want to "historize" in PG.

@ar-jan
Copy link

ar-jan commented Apr 12, 2017

But is it expected that there can be no other groups in the project? I thought that the historize action would act on just the selected group, so it shouldn't matter that there are also other groups.

@ar-jan
Copy link

ar-jan commented Jun 7, 2017

Just tried it again in a new project, and it seems that currently the only way historize a group is to have no other groups with layers present anywhere in the QGIS project. There can only be one group with the PostGIS layer to be versioned, or I get AttributeError: 'TileLayer' object has no attribute 'providerType'.

@SebastienPeillet
Copy link

Project migrated to : https://gitlab.com/Oslandia/qgis/qgis-versioning

@delhomer delhomer closed this as completed Jun 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants