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

multiedit in attribute table not working properly in version >=3.22 #48077

Closed
2 tasks done
paolomartinis opened this issue Apr 4, 2022 · 10 comments · Fixed by #51801
Closed
2 tasks done

multiedit in attribute table not working properly in version >=3.22 #48077

paolomartinis opened this issue Apr 4, 2022 · 10 comments · Fixed by #51801
Assignees
Labels
Attribute Table Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Editing Forms Regression Something which used to work, but doesn't anymore

Comments

@paolomartinis
Copy link

paolomartinis commented Apr 4, 2022

What is the bug or the crash?

Issue A:
When activating the Toggle multi edit mode in the Attribute Table for a generic database layer (e.g. a geopackage), Qgis raises the alert Changes to this form will not be saved. One field doesn't meet their constraints.,

Issue B:
Bypassing the issue by removing the unique identifier field from the Attributes Form fields list, by pressing the Toggle multi edit mode button Qgis says Attribute changes for multiple features applied.. Every subsequent change will apply to all the elements, not just the selected one.
This bug will cause data losses, in a critically way for Postgis or other remote database layers.
With QGIS 3.16 everything worked fine.
I found other threads online reporting the same problem, but no other issues here: e.g. https://gis.stackexchange.com/questions/417285/qgis-3-22-automatic-changes-by-multiedit-in-attribute-table

Steps to reproduce the issue

  1. Load a generic geopackage layer (e.g. the training_data.gpkg from https://docs.qgis.org/3.22/en/docs/training_manual/foreword/intro.html#data-downloadlink )
    Issue A:
  2. Open the Attribute Table for the selected layer in the geopackage
  3. Toggle the Toggle multi edit mode button
    Issue B:
  4. Open the Attributes Form tab in the Layer properties dialog
  5. Change the mode from autogenerate to drag and drop designer
  6. Remove the fid field from the Form layout list
  7. Open the Attribute Table for the selected layer in the geopackage
  8. Toggle the Toggle multi edit mode button
  9. Try to change one value for only some selected elements

Versions

QGIS version
3.22.5-Białowieża
QGIS code revision
c272317
Qt version
5.15.2
Python version
3.9.5
GDAL/OGR version
3.4.2
PROJ version
9.0.0
EPSG Registry database version
v10.054 (2022-02-13)
GEOS version
3.10.2-CAPI-1.16.0
SQLite version
3.38.1
PDAL version
2.3.0
PostgreSQL client version
13.0
SpatiaLite version
5.0.1
QWT version
6.1.3
QScintilla2 version
2.11.5
OS version
Windows 7 Version 6.1 (Build 22000)

Active Python plugins
AnotherDXF2Shape
1.2.3
Cxf_in
9.2
db-style-manager_MOD
0.9.0_MOD
GeofabrykaToolbox
0.5
GroupStats
2.2.5
idrostudi_toolbox
1.21
ImportEpanetInpFiles
1.6.3
joinmultiplelines
Version 0.4.1
mmqgis
2021.9.10
MultiEdit
1.1
multiple_layers_tools
1.2
nominatim
1.4.1
ntv2_transformations
0.20
plugin_reloader
0.9.1
QCopycanvas
0.5
qepanet
2.5
QGIS3_Delft3D_FM
1.0
QuickMultiAttributeEdit3
version 3.0.3
scriptrunner3
3.0.5
SpreadsheetLayers
2.0.1
StreetView
3.2
TerrainShading
0.9.3
wnt
1.3.4
db_manager
0.1.20
grassprovider
2.12.99
MetaSearch
0.3.5
processing
2.12.99
sagaprovider
2.12.99

Supported QGIS version

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

New profile

  • I tried with a new QGIS profile

Additional context

No response

@paolomartinis paolomartinis added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Apr 4, 2022
@elpaso
Copy link
Contributor

elpaso commented Apr 4, 2022

Maybe related to #47223

@szppaks
Copy link

szppaks commented May 27, 2022

I got the the same error with Postgres, ver >=3.22.
QGIS want to update all fields (include the unique ID field), not just the modified. This cause the " Changes to this form will not be saved. One field doesn't meet their constraints" alert.
So, we are downgrading to 3.16 LTR.

@LKajan
Copy link

LKajan commented Nov 16, 2022

I think this should be adressed as regression.
Multi editing works on 3.16 but on 3.22 and on latest nightly unique constraints prevents using multi editing completly.

@agiudiceandrea agiudiceandrea added the Regression Something which used to work, but doesn't anymore label Nov 19, 2022
@paolomartinis
Copy link
Author

paolomartinis commented Feb 8, 2023

editing of multiple attributes works in qgis >3.16 only by using the "Modify the attributes of all selected features simultaneously" button after selecting some features...
image
So I think that the problem is connected only to the table view...

@paolomartinis
Copy link
Author

@elpaso
according to you, can the solution of this issue can be sponsorized in any way? who can possibly take care of it? how can i contact her/him? staying downgraded to 3.16 is starting to become a real problem...

@elpaso
Copy link
Contributor

elpaso commented Feb 10, 2023

@paolomartinis I'm looking at the issue.

Regarding issue A:

I think that it is caused by the layer not having any selected feature.

Here is my proposal to fix it: instead of showing the warning, we show a nice info.

bug_48077_A

@elpaso
Copy link
Contributor

elpaso commented Feb 10, 2023

Next time please file two separate issues for A and B, it is easier for us to handle atomic issues.

elpaso added a commit to elpaso/QGIS that referenced this issue Feb 10, 2023
elpaso added a commit to elpaso/QGIS that referenced this issue Feb 10, 2023
elpaso added a commit to elpaso/QGIS that referenced this issue Feb 10, 2023
elpaso added a commit to elpaso/QGIS that referenced this issue Feb 10, 2023
@rekjuh
Copy link

rekjuh commented Jan 18, 2024

Just in case someone who has the same problem finds this issue and has to use QGIS version 3.28.6. or < 3.30. where the bug hasn't been fixed:

My customer just had the same problem as described in here part A ("Changes to this form will not be saved. One field doesn't meet their constraints." while trying to use multiedit in attribute table).

The problem could be solved by opening the Properties of the layer in question and going to the Attribute forms page. As the problem is in this case the ID field, select that from the list. Under the "Constraints" are "Enforce not null constraint" and "Enforce unique constraint". Try unchecking them. You have to either have both of them or only one of them unchecked. Now multiediting is possible without the getting the "One field doesn't meet their constraints".

Note! ID field is maybe the most important field of your layer, so you usually want each feature to have unique ID or not a null value as ID. If you multiedit other fields, QGIS won't change the IDs but always double-check that they remain unchanged. Alternatively uncheck "Editable" in the same place you made the previous changes (Properties > Attribute forms > ID). Now the ID field cannot be edited while you edit other values.

image

@szppaks
Copy link

szppaks commented Jan 18, 2024 via email

@mugabonkundi
Copy link

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Attribute Table Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Editing Forms Regression Something which used to work, but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants