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

DB default values override actual values in merge selected features tool #59494

Open
2 tasks done
Joonalai opened this issue Nov 19, 2024 · 2 comments · May be fixed by #60710
Open
2 tasks done

DB default values override actual values in merge selected features tool #59494

Joonalai opened this issue Nov 19, 2024 · 2 comments · May be fixed by #60710
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!

Comments

@Joonalai
Copy link
Contributor

Joonalai commented Nov 19, 2024

What is the bug or the crash?

When using database level default values, Merge Selected Features tool displays this default value in merge row. Also the header column is set to Manual Value. The correct behavior would be to select value of the first feature as in other columns.

default_overrides_merge

This bug occurs at least with GPKG and PostGIS. QGIS form default values do not change the behavior.

Steps to reproduce the issue

To reproduce the bug I prepared a merge.zip containing merge.gpkg which has line layer with two fields "code" and "field2". "code" field has a default value of 1 set at the table level (ALTER TABLE line ADD COLUMN code int default 1).

  1. Download and extract merge.zip
  2. Start QGIS and open project from that geopackage
  3. Start editing line layer
  4. Select both features and click Merge Selected Features tool
  5. See how the header of column "code" is set to Manual Value and the Merge cell is set to 1

Versions

QGIS version3.40.0-Bratislava
QGIS code revisionb56115d874
 
Libraries
Qt version5.15.13
Python version3.12.7
GDAL/OGR version3.9.3
PROJ version9.5.0
EPSG Registry database versionv11.016 (2024-08-31)
GEOS version3.13.0-CAPI-1.19.0
SQLite version3.46.1
PDAL version2.8.1
PostgreSQL client versionunknown
SpatiaLite version5.1.0
QWT version6.3.0
QScintilla2 version2.14.1
OS versionWindows 10 Version 2009
 
Active Python plugins
db_manager0.1.20
grassprovider2.12.99
MetaSearch0.3.6
processing2.12.99

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

If Value Map or relation reference is used, the default value is displayed without mapping. Only when user clicks the cell, the mapped value is displayed.

default_overrides_value_map

@Joonalai Joonalai added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Nov 19, 2024
@phidrho
Copy link
Contributor

phidrho commented Dec 12, 2024

Have you tried enabling/disabling option in project properties:
Project > Properties > Data Sources > Evaluate default values on provider side.

Evaluate default values setting

@Joonalai
Copy link
Contributor Author

I tried it but it makes no difference:

image

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!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants