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

(Un)force hide form in relation widget #47226

Closed
2 tasks done
karl-magnus opened this issue Feb 7, 2022 · 4 comments · Fixed by #47245
Closed
2 tasks done

(Un)force hide form in relation widget #47226

karl-magnus opened this issue Feb 7, 2022 · 4 comments · Fixed by #47245
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Forms Relations

Comments

@karl-magnus
Copy link

What is the bug or the crash?

When the option to force hide form in the relation widget is selected, you can't unselect it to get the form to open in a new window again.

Steps to reproduce the issue

  1. In an new project add two tables that could be related to each other 1:N. I have no geometry.
    bild

  2. Add the relation in project properties. The form for new child features opens as a new window as default.
    bild

  3. Edit the Layer Properties -> Attributes Form for the parent table to use Drag and Drop Designer, add the Related child form to the parent form layout and select to Force hide form on add features. The form form for new child features opens in same parent form as expected.
    bild

  4. Edit the Layer Properties -> Attributes Form again and unselect to Force hide form on add features.

  5. I get a warning : Deprecation Warning: Trying to set a relation config directly on the relation best_9a4a9b84_a270_4078_bad7_4b1a8102db16_plan_uuid_plan_c595510d_0873_4fd5_b7a1_add047b954fc_plan_uuid. Relation settings should be done for the specific widget instance instead. Use attributeEditorRelation->setNmRelationId() or attributeEditorRelation->setForceSuppressFormPopup() instead.

  6. And the form still doesn't open in a new window

Versions

<style type="text/css"> p, li { white-space: pre-wrap; } </style>
QGIS version 3.22.3-Białowieża QGIS code revision 1628765
Qt version 5.15.2
Python version 3.9.5
GDAL/OGR version 3.4.1
PROJ version 8.2.1
EPSG Registry database version v10.041 (2021-12-03)
GEOS version 3.10.0-CAPI-1.16.0
SQLite version 3.35.2
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 10 Version 2009
       
Active Python plugins
DigitizingTools 1.5.1
Discovery 2.5.7
FilterLayersAtOnce-master 1.0
Qaava 0.1.0
Qgis2threejs 2.6
qgis_resource_sharing 0.16.0
db_manager 0.1.20
grassprovider 2.12.99
MetaSearch 0.3.5
processing 2.12.99
sagaprovider 2.12.99
QGIS version 3.22.3-Białowieża QGIS code revision [1628765](https://github.com/qgis/QGIS/commit/1628765ec7) Qt version 5.15.2 Python version 3.9.5 GDAL/OGR version 3.4.1 PROJ version 8.2.1 EPSG Registry database version v10.041 (2021-12-03) GEOS version 3.10.0-CAPI-1.16.0 SQLite version 3.35.2 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 10 Version 2009

Active Python plugins
DigitizingTools
1.5.1
Discovery
2.5.7
FilterLayersAtOnce-master
1.0
Qaava
0.1.0
Qgis2threejs
2.6
qgis_resource_sharing
0.16.0
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

I have Postgresql tables and automatic transaction groups enabled. Since I have "NOT NULL" constraints without any default values in the child table I get errors from the database and can not insert any new features in the child table. A new project with repeated steps without checking (Force hide...) doesn't solve the problem. A restart of QGIS (or new profile) solves the problem. It seems that the setting gets global in the current session and can't get unset.

@karl-magnus karl-magnus added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Feb 7, 2022
@elpaso
Copy link
Contributor

elpaso commented Feb 7, 2022

Cannot reproduce on current master/linux.

@gioman gioman added the Feedback Waiting on the submitter for answers label Feb 7, 2022
@karl-magnus
Copy link
Author

I can try to find out more. Any suggestions? But This is what it looks like. Clean new profile now. Also tried with just scratch layers.
Setting 1:
bild
Result 1:
bild
Setting 2:
bild
Result 2:
bild
Setting 1 again:
bild
Result as 2 but expected 1:
bild
Same result with just temporary scratch layers:
bild
bild
2022-02-07T17:11:39 WARNING Deprecation Warning: Trying to set a relation config directly on the relation New_child__parent_id_New_parent_id. Relation settings should be done for the specific widget instance instead. Use attributeEditorRelation->setNmRelationId() or attributeEditorRelation->setForceSuppressFormPopup() instead.

@elpaso
Copy link
Contributor

elpaso commented Feb 7, 2022

I tested the standalone form from identify and not from the attribute table, this might explain why I couldn't reproduce, I can reproduce it from the attr table.

@gioman gioman removed the Feedback Waiting on the submitter for answers label Feb 7, 2022
@karl-magnus
Copy link
Author

Yes, forgot that important detail. Good with a lot of screenshots. Since I have no geometry I have to go through the attribute table.

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.

3 participants