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

Relation Reference Embedded Form not updated #60806

Open
2 tasks done
signedav opened this issue Feb 28, 2025 · 1 comment · May be fixed by #60932
Open
2 tasks done

Relation Reference Embedded Form not updated #60806

signedav opened this issue Feb 28, 2025 · 1 comment · May be fixed by #60932
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Forms Relations

Comments

@signedav
Copy link
Contributor

What is the bug or the crash?

When having a parent linked to a child and using the Relation Reference Widget with the option "Embedded Form"...

Image

... changes in this embedded form (where the the parent feature is) are only updated, when something changes on the main form (where the child feature is).

While this scenario works with joined fields

Steps to reproduce the issue

  • In the attached project I open a form from an "addresse" feature (child feature).

  • I change something in the embedded form (means the "gebaeude" (parent feature)).
    Image

  • Pressing okay - nothing is saved...

  • In the attached project I open a form from an "addresse" feature (child feature).

  • I change something in the embedded form (means the "gebaeude" (parent feature)).

  • and I change something in the main form
    Image

  • Pressing okay - changes are saved on both features.

Versions

QGIS version3.43.0-Master
QGIS code revision4de10b9d4cd
 
Libraries
Qt version5.15.3
Python version3.10.12
GDAL version3.9.0dev-365401613a
PROJ version8.2.1
EPSG Registry database versionv10.041 (2021-12-03)
GEOS version3.10.2-CAPI-1.16.0
SQLite version3.37.2
PDAL version2.3.0
PostgreSQL client version17.0
SpatiaLite version5.0.1
QWT version6.1.4
QScintilla2 version2.11.6
OS versionUbuntu 22.04.5 LTS
This copy of QGIS writes debugging output.
 
Active Python plugins
grassprovider2.12.99
processing2.12.99
MetaSearch0.3.6
db_manager0.1.20

Supported QGIS version

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

New profile

Additional context

relrefwidgetembed.zip <- in the zip is a gpkg and in the gpkg is a project...

@signedav signedav added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Feb 28, 2025
@signedav
Copy link
Contributor Author

And here some notes to myself:

When the parent (child-feature) not dirty is, the embedded feature don't get's saved neither.

The save is triggerd somewhere around this
success = mLayer->changeAttributeValues( mFeature.id(), newValues, oldValues, false, context.get() );

in this function: 
QgsAttributeForm::saveEdits

With joined fields this works. Without making the parent dirty...

Bei jedem editieren eines Feldes wird updateJoinedFields ausgeführt. Auch bei den Joined oder Embedded (wobei ich natürlich nicht weiss auf welcher ebene). Aber vielleicht würde das auch irgendwie für das andere gehen.

signedav added a commit to signedav/QGIS that referenced this issue Mar 10, 2025
…n the embedded form if existing.

This function is called on aboutToSave, an override of the WidgetWrapper that is triggered via notifyAboutToSave from the attribute form.
This fixes qgis#60806
@signedav signedav linked a pull request Mar 10, 2025 that will close this issue
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! Forms Relations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants