qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.09k stars 2.93k forks source link

Unexpected behavior using multiedit support for relation editor #48966

Open jrosleo opened 2 years ago

jrosleo commented 2 years ago

What is the bug or the crash?

Multiedit support for relation editor fails in the context that is described.

Steps to reproduce the issue

  1. Create a SpatiaLite with this schema or use this template.
CREATE TABLE t1_parent (
    id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, 
    name TEXT
);

SELECT AddGeometryColumn('t1_parent', 'geom', 32628, 'POLYGON', 'XY');
SELECT CreateSpatialIndex('t1_parent', 'geom');

CREATE TABLE t1_child (
    id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, 
    name TEXT,
    parent_id INTEGER REFERENCES t1_parent(id) DEFERRABLE INITIALLY DEFERRED
);
  1. Activate Automatically create transaction groups where possible and Evaluate default values on provider side project options.
  2. Set up a relation between tables.

image

  1. Configure t1_parent form.

image

  1. Create 3 parents with 2 childs each one. After start an editing session, select the 3 parent features and press "Modify the Attributes of All Selected Features Simultaneously" you will see:

image

  1. If you clic on "Add child feature" this error happens.

image

Versions

QGIS version 3.24.2-Tisler QGIS code revision 13c1a028 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 unknown SpatiaLite version 5.0.1 QWT version 6.1.3 QScintilla2 version 2.11.5 OS version Windows 10 Version 2009

Active Python plugins db_manager 0.1.20 grassprovider 2.12.99 MetaSearch 0.3.6 processing 2.12.99 sagaprovider 2.12.99

Supported QGIS version

New profile

Additional context

Multi edit support for relation editor was developed by @domi4484. See changelog for QGIS 3.24.

domi4484 commented 1 year ago

Probably introduced in #47392. See comment https://github.com/qgis/QGIS/pull/47392/files#r1128103338