Bug report #12881

Incorrect Loading of Layer Group in Layer Definition File (*.qlr)

Added by weston mcarron almost 9 years ago. Updated almost 9 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Map Legend
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:20972

Description

This issue is probably a little broader than this, but I can reproduce it in the following way:

  • Add a layer from PostGIS with an SQL filter applied.
  • Add another layer from PostGIS with a different SQL filter applied.
  • Add both layers to a layer group.
  • Save the layer group to a Layer Definition File (*.qlr).
  • Load the *.qlr file into a non-empty project.

Every time I do it, the group loads with two layers, but the layers are always identical. In one case, it loaded the filter, the name and the style of the first layer twice. In another case it loaded the filter from one layer and the name from the other.

Associated revisions

Revision a316290a
Added by Nathan Woodrow almost 9 years ago

Fix #12881 - Fix loading of QLR files with the same layers

Using just date stamps wasn't fine enough

Funded By TechnologyOne, Australia

Revision f4eca224
Added by Nathan Woodrow almost 9 years ago

Fix #12881 - Fix loading of QLR files with the same layers

Using just date stamps wasn't fine enough

Funded By TechnologyOne, Australia

- Backported to 2.8.3
- Cherry-picked from a316290ada9e3141358d

History

#1 Updated by Giovanni Manghi almost 9 years ago

  • Category changed from Browser to Map Legend
  • Status changed from Open to Feedback

just tested the above steps on qgsi master and got always the expected outcome.

#2 Updated by weston mcarron almost 9 years ago

I just reread my steps and realized I wasn't clear enough.

On step 2, the layer has to be from the same PostGIS table as in step 1, but with a different filter applied.

So two layers, both of which draw on the same PostGIS table.

Can you reproduce it that way?

#3 Updated by weston mcarron almost 9 years ago

Also, the non-empty project in the last step seemed to be important for duplicating it. If I loaded the qlr file into a fresh project with no other layers it seemed to work fine.

#4 Updated by Giovanni Manghi almost 9 years ago

  • Status changed from Feedback to Open
  • Affected QGIS version changed from 2.8.2 to master

Can you reproduce it that way?

yes

#5 Updated by Anonymous almost 9 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF