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

Copy/paste style category "Form" is missing some settings #45146

Open
2 tasks done
pathmapper opened this issue Sep 20, 2021 · 7 comments
Open
2 tasks done

Copy/paste style category "Form" is missing some settings #45146

pathmapper opened this issue Sep 20, 2021 · 7 comments
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Forms Styles

Comments

@pathmapper
Copy link
Contributor

What is the bug or the crash?

Copy/paste style category Form is missing some settings, e.g. the Default value for Text Edit Widget type.

Steps to reproduce the issue

  1. Open test_project_and_data.zip
  2. Check the Form settings for layer testdata with form in layer properties: The field GN has a Default value
  3. Copy the Form settings from layer testdata with form using the layer contextmenu: Styles -> Copy Style -> Form
  4. Paste the Form settings to layer testdata using the layer contextmenu: Style -> Paste Style -> Form
  5. Check the Form settings for layer testdata in layer properties: The Default value for field GN is missing.

bug_copy_form

Versions

QGIS version 3.21.0-Master QGIS code revision 08d8ccb
Qt version 5.12.8
Python version 3.8.10
GDAL/OGR version 3.0.4
PROJ version 6.3.1
EPSG Registry database version v9.8.6 (2020-01-22)
Compiled against GEOS 3.8.0-CAPI-1.13.1 Running against GEOS 3.8.0-CAPI-1.13.1
SQLite version 3.31.1
PostgreSQL client version 12.8 (Ubuntu 12.8-0ubuntu0.20.04.1)
SpatiaLite version 4.3.0a
QWT version 6.1.4
QScintilla2 version 2.11.2
OS version Ubuntu 20.04.3 LTS
       
Active Python plugins sagaprovidergrassproviderMetaSearchprocessingdb_manager

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

Some other form settings are also missing, e.g. the Constraints.

@pathmapper pathmapper added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Sep 20, 2021
@elpaso elpaso self-assigned this Sep 20, 2021
@elpaso
Copy link
Contributor

elpaso commented Sep 20, 2021

The source of the issue is that the information about default values is stored in the "Fields" category even if in the properties dialog it is editable in the "Forms" tab, I'll check how this can be fixed but I'm afraid it could potentially break existing code (e.g. from plugins).

@3nids / @m-kuhn any though on this topic?

@3nids
Copy link
Member

3nids commented Sep 20, 2021

The categories of the copy/paste do not exactly match the tab I guess.

It might make sense to group the two categories into a single one?

@elpaso
Copy link
Contributor

elpaso commented Sep 20, 2021

The categories of the copy/paste do not exactly match the tab I guess.

It might make sense to group the two categories into a single one?

Probably a good idea. From a user perspective i think it is expected that the categories match the tabs (same name, same icon etc.).

There isn't much information stored in the "Fields" tab right now, it's just the flags IIRC.

@3nids
Copy link
Member

3nids commented Sep 20, 2021

yes, exactly.
I think Fields category is constraints + defaults + alias + flags.

I have no strong opinion.
The current approach is the most logic from a semantic point of view, but might not be very intuitive.

I think this can be reduce to the question: would there be a case where it makes sense to copy only fields or only forms.

@pathmapper
Copy link
Contributor Author

@elpaso @3nids thanks for looking into this and the workaround (= copy/paste All Style Categories).

i think it is expected that the categories match the tabs (same name, same icon etc.).

Would be great, here's an attempt to map the current situation (not entirely sure about everything, also might be that Custom Properties, Geometry Options and Relations are also having an equivalent):

image

@bastooo
Copy link

bastooo commented May 12, 2022

I just had the experience to break my project, due to the confusing bug, that the constraint & default values are not stored in the Forms subcategory. So I copied half of the information and later on, the data, which was collected in the field was complete rubbish..

I would appreciate a lot, if I copy the Forms-style information from one layer to another, that everything I configured is copied.

@pathmapper
Copy link
Contributor Author

pathmapper commented Jan 9, 2023

Note:
Layer Variables is in Custom Properties

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 Styles
Projects
None yet
Development

No branches or pull requests

5 participants