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

Value-list in value-relation stays empty within a 1:n-relation when using current_parent_value('parent_field') #40194

Closed
koenigherford opened this issue Nov 19, 2020 · 5 comments
Labels
Expressions Related to the QGIS expression engine or specific expression functions Feedback Waiting on the submitter for answers Relations

Comments

@koenigherford
Copy link

The value-list in value-relation stays empty within a 1:n-relation when using current_parent_value('parent_field') in the first step when creating a new child-feature (which is not an expected behaviour) but is filled as expected after confirming a empty value-list.

Some sceenshots and the attached-sample-project shows more than thousand words...:
I set up a sample project with following settings:

grafik

The child-features-layer is empty.

The relation is set up like:
grafik

grafik

(Step 0: Create some parent-features and save them because of #40129)

When editing the parent-feature to add child-features (Step 1: Identify; Step 2: Add new feature) the avaliable value-list stays empty (Step 3)

grafik

After pressing OK (Step 4) the value-list is filled now as expected (Step 5).
This causes following problems:
Problem 1: In step 3/4 the User thinks, something is set up wrong/he may think not to be able to create a new feature, but step 5 shows, all iss set up well and creation of child-features is possible
Problem 2: Unnecessary steps to create a feature.

grafik

Sample project:
current_parent_value_test_project.zip

QGIS 3.16.0

@koenigherford koenigherford added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Nov 19, 2020
@gioman gioman added Relations Expressions Related to the QGIS expression engine or specific expression functions labels Nov 19, 2020
@elpaso
Copy link
Contributor

elpaso commented Nov 24, 2020

The bad new is that it wasn't designed to work like that: the "parent" form is for embedded forms only.

The good new is that using drag and drop designer and setting "Force hide form on add feature" it works as expected because in that case the embedded sub-form has a parent.

immagine

@elpaso elpaso removed the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Nov 24, 2020
@elpaso
Copy link
Contributor

elpaso commented Nov 24, 2020

Not a bug IMO, maybe it could be better documented.

@gioman
Copy link
Contributor

gioman commented Nov 24, 2020

We need either the "Bug" or "Feature request" labels. If is not a bug or a feature request this should be closed. Or eventually moved to the docs tracker.

@gioman gioman added the Feedback Waiting on the submitter for answers label Nov 24, 2020
@koenigherford
Copy link
Author

@elapso: Could not reproduce your approach: My LayerPropertiesDialog looks different in various places:

Checkboxes (from right side of your sceenshot) are missing.
grafik

Form stays empty
grafik

QGIS-Version 3.16.0-Hannover QGIS-Codeversion 43b64b1
Kompiliert gegen Qt 5.11.2 Laufendes Qt 5.11.2
Kompiliert mit GDAL/OGR 3.1.4 Läuft mit GDAL/OGR 3.1.4
Kompiliert mit GEOS 3.8.1-CAPI-1.13.3 Läuft mit GEOS 3.8.1-CAPI-1.13.3
Kompiliert mit SQLite 3.29.0 Läuft mit SQLite 3.29.0
PostgreSQL-Client-Version 11.5 SpatiaLite-Version 4.3.0
QWT-Version 6.1.3 QScintilla2-Version 2.10.8
Kompiliert mit PROJ 6.3.2 Läuft mit PROJ Rel. 6.3.2, May 1st, 2020
BS-Version Windows 10 (10.0)

What mistake did I do ?

@koenigherford
Copy link
Author

Excuse me. My mistake.
Your approach worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Expressions Related to the QGIS expression engine or specific expression functions Feedback Waiting on the submitter for answers Relations
Projects
None yet
Development

No branches or pull requests

3 participants