Layer with same name as in previous project get path from the previous layer in the qgs-file #59050
Open
1 of 2 tasks
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
What is the bug or the crash?
If I open a qqz-file with a shape file layer named for example "test". If I then click "New project" and add another shape file layer called "test" from another map, it will look ok as long as I have the project opened. When I save and close QGIS and open the project again, it will be the layer from the first qgz-file that is shown. I digged a bit deeper and found that in the qgs-file, the path in the source is correct under "layer-tree-layer", but has the path from the other layer in "datasource" under "MapLayer".
Steps to reproduce the issue
open QGIS
Create a shape file (polygon) named test.shp in folder test1
draw a square.
save the layer
Create a second shape file (polygon) named test.shp in folder test2
draw a triangle
save the layer
close QGIS
Open QGIS
import test.shp from test1 folder.
Save the QGIS project in test1 folder, name it test1.qgz
close QGIS
Open test1.qgz from File Explorer by double clicking it.
Create a new project in QGIS (Project --> New)
Add test.shp from test2 folder
Save the QGIS project in test2 folder, name it test2.qgz
close QGIS
Open test2.qgz from File Explorer by double clicking it.
Now you will see test.shp from test1 folder instead of the test.shp layer in test2 folder...
Versions
same problem in both 3.34.0 and 3.38.3-1
Supported QGIS version
New profile
Additional context
Tested on 3 different computers, but same issue on all.
The text was updated successfully, but these errors were encountered: