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

Many-to-many field behaviour inconsistent with QGIS #5180

Open
agseaton opened this issue Apr 11, 2024 · 0 comments
Open

Many-to-many field behaviour inconsistent with QGIS #5180

agseaton opened this issue Apr 11, 2024 · 0 comments

Comments

@agseaton
Copy link

Describe the issue

The behaviour in QField of many to many fields is not consistent with that in QGIS.

In the QGIS attribute form configuration, a many-to-many field can be configured to allow the user to add, delete, link, or unlink items in the target table.

Screenshot from 2024-04-11 16-00-08

However, the link and unlink options don't work in QField -- the field is blank and can't be edited.

Additionally, while the add and delete options work in QField, and they actually function as 'link' and 'unlink' do in QGIS, i.e. they don't actually allow creation and deletion of rows in the target table.

Reproduction steps

  1. Set up two tables and a join table
  2. Configure QGIS relations for a many-to-many relationship between the two tables
  3. Set up attribute form for the relation with either 'link' and 'unlink' selected, or 'add' and 'delete'.
  4. Export to QField
  5. Test form in QField.

Expected behavior

If link and unlink are selected:
Screenshot from 2024-04-11 16-00-08

Form should allow linking/unlinking an existing child feature, as shown in QGIS:
Screenshot from 2024-04-11 16-10-45

Screenshot from 2024-04-11 16-06-55

If add and delete are selected:
Screenshot from 2024-04-11 16-15-14

Form should allow adding new features/deleting existing ones from the child table, again demonstrated in QGIS:
Screenshot from 2024-04-11 16-12-44

Screenshot from 2024-04-11 16-13-59

Observed behavior

If link and unlink are selected:
QField widget doesn't do anything

Screenshot from 2024-04-11 16-15-52

If add and delete are selected:
QField widget is functional, but actually just allows linking and unlinking, not adding and deleting:

Screenshot from 2024-04-11 16-19-17

image

Screenshot from 2024-04-11 16-19-46

Note here also that QField displays the attributes form for the join table, whereas QGIS bypasses that entirely (which is the desired behaviour).

Sample project file & database

m2m.zip

Desktop (please complete the following information)

  • OS: Ubuntu 22.04.4 LTS
  • QGIS Version 3.34.5-Prizren
  • QFieldSync Version v4.9.1

Mobile (please complete the following information)

  • Device: Oneplus 11
  • OS: Android 14
  • QField version: 3.2.2 - Congo 72be17

Additional information

  • Problem started happening recently, didn't happen in an older version of QField: No
  • Problem can be reliably reproduced, doesn't happen randomly: Yes
  • Problem happens with all files and projects, not only some files or projects: Tested with GPKG and spatialite.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant