Bug report #16534

DB manager virtual layers: wrong list, layers removed from project

Added by Giovanni Manghi over 4 years ago. Updated over 4 years ago.

Status:Closed
Priority:High
Assignee:-
Category:DB Manager
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:duplicate
Crashes QGIS or corrupts data:Yes Copied to github as #:24440

Description

This has been seen on 2.18.7 and master (QGIS 3) as well. Steps to replicate the issues:

  • Load a shapefile
  • Open DB Manager > look into the "virtual layers/QGIS layers group", the shapefile loaded in the project is listed
  • Browse a PostGIS connection, select a table and preview its geometries
  • Select again "virtual layers/QGIS layers group" and click on the refresh button > the previewed layer in now in the virtual layers group(?). This only happens if in the above steps you preview the geometries, does not happen if you preview the table or see the table infos
  • Now preview the geometries of the (Postgis) table as visible in the virtual layers group > mouse pointer hourglass pointer starts and never ends
  • Click on the (shapefile) layer as visible in the "virtual layers" group
  • Click on the (PostGIS) layer as visible in the "virtual layers" group > the shapefile is REMOVED from the project

Related issues

Duplicates QGIS Application - Bug report #16476: DB Manager: previewing layers in Virtual layers section r... Closed 2017-04-27

History

#1 Updated by Giovanni Manghi over 4 years ago

also while doing the above steps I have also seen this (not always):

Traceback (most recent call last):
  File "C:/OSGEO4~1/apps/qgis/./python/plugins\db_manager\layer_preview.py", line 67, in runPrev
    return self._loadTablePreview(item)
  File "C:/OSGEO4~1/apps/qgis/./python/plugins\db_manager\layer_preview.py", line 116, in _loadTablePreview
    if not vl.isValid():
AttributeError: 'NoneType' object has no attribute 'isValid'

#2 Updated by Luigi Pirelli over 4 years ago

seems that db_manager qgis layer list in Virtual Layer gets layers form shown layers in the QgsMapCanvas instance of the preview table

#3 Updated by Harrissou Santanna over 4 years ago

Is this a duplicate of #16476?

#4 Updated by Luigi Pirelli over 4 years ago

right Harrissou

#5 Updated by Giovanni Manghi over 4 years ago

  • Resolution set to duplicate
  • Status changed from Open to Closed

#6 Updated by Jürgen Fischer over 4 years ago

  • Duplicates Bug report #16476: DB Manager: previewing layers in Virtual layers section remove them from the Layers panel added

Also available in: Atom PDF