Bug report #16476

DB Manager: previewing layers in Virtual layers section remove them from the Layers panel

Added by Harrissou Santanna over 7 years ago. Updated over 6 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:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:Yes Copied to github as #:24385

Description

Open a project
Launch DB Manager, expand the Virtual layers section, then QGIs layers and select a layer
Click the Preview tab
Select another layer
The layer you selected first has been removed from the Layers panel, hence from the project (GUI, at least)

Happens also in master
Set the report as high because this can easily corrupt the project if you don't notice the removal (and anyway, if you notice it, you'll need to close and not save the project to avoid it being corrupted)


Related issues

Duplicated by QGIS Application - Bug report #16534: DB manager virtual layers: wrong list, layers removed fro... Closed 2017-05-09

Associated revisions

Revision 68b7bf6a
Added by Salvatore Larosa almost 7 years ago

[dbmanager] porting of dae921c to 3: fixes #16476

Revision 6f09f174
Added by Luigi Pirelli almost 7 years ago

Merge pull request #6255 from slarosa/fix_16476

[dbmanager] porting of dae921c to 3: fixes #16476

History

#1 Updated by Harrissou Santanna over 7 years ago

  • Subject changed from DB Manager: previewing layers remove them from the Layers panel to DB Manager: previewing layers in Virtual layers section remove them from the Layers panel

#2 Updated by Giovanni Manghi over 7 years ago

  • Regression? set to No
  • Easy fix? set to No

#3 Updated by Giovanni Manghi over 7 years ago

  • Description updated (diff)
  • Crashes QGIS or corrupts data changed from No to Yes

#4 Updated by Luigi Pirelli over 7 years ago

the problem is a logic problem... the db_manager base class layer_preview remove from registry any previously added layer (currentLayer) with it's id, with assumption that it's id is a temporary layer because has been added for the preview.

virtual layer qgis layer is populated of all registry layers => also that are in the layer list, when you click on that it become current layer => it is removed when switching to another layer in db_manager

looking for a simple solution for that

#5 Updated by Giovanni Manghi over 7 years ago

see also #16534

#6 Updated by Luigi Pirelli over 7 years ago

  • Pull Request or Patch supplied changed from No to Yes

fixed for 2.18 https://github.com/qgis/QGIS/pull/4534 waiting for review and merge, expecially review by Hugo Mercier.
fix for 3.0 will be delayed because actually in this version db_manager raise much more exception than the 2.18 or 2.14 one => I'll try to work in a general PR fixup most common one.

#7 Updated by Jürgen Fischer over 7 years ago

  • Duplicated by Bug report #16534: DB manager virtual layers: wrong list, layers removed from project added

#8 Updated by Salvatore Larosa over 7 years ago

  • Status changed from Open to Closed

#9 Updated by Harrissou Santanna almost 7 years ago

  • Status changed from Closed to Reopened
  • Affected QGIS version changed from 2.18.7 to master

Looks like the fix for QGIS 3 never landed

#10 Updated by Salvatore Larosa almost 7 years ago

  • % Done changed from 0 to 100
  • Status changed from Reopened to Closed

#11 Updated by Giovanni Manghi over 6 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF