Bug report #13913
Embed layers and groups does not work properly with layer duplicate names
|Affected QGIS version:||3.0.0||Regression?:||Yes|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||21935|
On QGIS desktop, if I include layers and groups from two different projects, and the layers and groups have the same name, the second project is ignored, and the first layers are loaded twice instead.
I agree that having duplicate names is risky, but:
- there are legitimate case where this may occur (e.g. several groups with the same internal structure)
- if this is not allowed, a check should be in place, and the user should be warned not to do it; ideally an automatic renaming mechanism should be offered in the dialog.
#1 Updated by Sebastian Dietrich almost 7 years ago
Additionally I encountered the following error:
If you have two or more groups with identical names QGIS always embeds the first one, no matter which one you select.
- Create a project with a layout like this:
- Embed the second group, containing Layer_Y.
- The first group, containing Layer_X, is embedded.
#2 Updated by Sebastian Dietrich almost 7 years ago
- Affected QGIS version changed from 2.8.3 to master
Importing layers with the same name works for me, as long as they do have different layer-IDs.
If they have the same layer-ID, e.g. because I used Save project as..., embedding does not work, even after renaming the second layer. See #9598.
#4 Updated by Paolo Cavallini over 4 years ago
- Regression? changed from No to Yes
- Affected QGIS version changed from master to 3.0.0
- Description updated (diff)
- layers with the same name from different project are not loaded
- styles are not preserved (this could warrant a separate ticket).