Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Shapefile layer silently overwrite existing files #44299

Closed
GeoJGH opened this issue Jul 21, 2021 · 1 comment · Fixed by #45207
Closed

New Shapefile layer silently overwrite existing files #44299

GeoJGH opened this issue Jul 21, 2021 · 1 comment · Fixed by #45207
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption GUI/UX Related to QGIS application GUI or User Experience

Comments

@GeoJGH
Copy link

GeoJGH commented Jul 21, 2021

QGIS version 3.16.8-Hannover QGIS code revision 8c50902
Compiled against Qt 5.11.2 Running against Qt 5.11.2
Compiled against GDAL/OGR 3.1.4 Running against GDAL/OGR 3.1.4
Compiled against GEOS 3.8.1-CAPI-1.13.3 Running against GEOS 3.8.1-CAPI-1.13.3
Compiled against SQLite 3.29.0 Running against SQLite 3.29.0
PostgreSQL Client Version 11.5 SpatiaLite Version 4.3.0
QWT Version 6.1.3 QScintilla2 Version 2.10.8
Compiled against PROJ 6.3.2 Running against PROJ Rel. 6.3.2, May 1st, 2020
OS Version Windows 10 (10.0)

When creating a new Shapefile ( menu Layer / Create layer / new Shapefile Layer...), one can either select or write a new layer name. When selecting it (using the ... button), the full path + name + .shp extension is returned. If such file already exists, a warning is shown.

If the user just enters a name, without the .shp extension, (with or without a path), the set of Shapefile files are created. Any existing Shapefile will be overwritten without any warning.

Expected behavior: a warning should be shown that the layer will be overwritten

Step to reproduce:

  1. 1st file: menu Layer / Create layer / new Shapefile Layer..., enter the name test, select a geometry type and click ok to create the shapefiles
  2. overwrite: Remove current layer, menu Layer / Create layer / new Shapefile Layer..., enter the same name test, select a geometry type and click ok to create the shapefiles --> files are overwritten, no warning is shown
  3. warning with extension: Remove current layer, menu Layer / Create layer / new Shapefile Layer..., enter the same name, with extension test.shp, select a geometry type and click ok to create the shapefiles -->A warning is shown informing that the layer already exists and will be overwritten
@GeoJGH GeoJGH added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jul 21, 2021
@gioman gioman added the GUI/UX Related to QGIS application GUI or User Experience label Jul 21, 2021
@uclaros
Copy link
Contributor

uclaros commented Jul 23, 2021

Confirmed on Linux too. The data corruption flag is appropriate I think.

What's also not nice is that in the case that the warning is shown, if cancel is pressed the New shapefile layer dialog is closed losing all entered fields.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Aug 7, 2021
@m-kuhn m-kuhn removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Aug 27, 2021
@rouault rouault self-assigned this Sep 22, 2021
rouault added a commit to rouault/QGIS that referenced this issue Sep 22, 2021
…e extension is not specified

and avoid closing the dialog when the user doesn't confirm overwriting

Fixes qgis#44299
rouault added a commit to rouault/QGIS that referenced this issue Sep 22, 2021
…e extension is not specified

and avoid closing the dialog when the user doesn't confirm overwriting

Fixes qgis#44299
nyalldawson pushed a commit that referenced this issue Sep 24, 2021
…e extension is not specified

and avoid closing the dialog when the user doesn't confirm overwriting

Fixes #44299
rouault added a commit to rouault/QGIS that referenced this issue Sep 24, 2021
…e extension is not specified

and avoid closing the dialog when the user doesn't confirm overwriting

Fixes qgis#44299
nyalldawson pushed a commit that referenced this issue Sep 24, 2021
…e extension is not specified

and avoid closing the dialog when the user doesn't confirm overwriting

Fixes #44299
espinafre pushed a commit to espinafre/QGIS that referenced this issue Sep 29, 2021
…e extension is not specified

and avoid closing the dialog when the user doesn't confirm overwriting

Fixes qgis#44299
nyalldawson pushed a commit that referenced this issue Nov 1, 2021
…e extension is not specified

and avoid closing the dialog when the user doesn't confirm overwriting

Fixes #44299
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption GUI/UX Related to QGIS application GUI or User Experience
Projects
None yet
5 participants