opengisch / QField

A simplified touch optimized interface for QGIS
http://www.qfield.org
GNU General Public License v2.0
843 stars 230 forks source link

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

Open agseaton opened 7 months ago

agseaton commented 7 months ago

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)

Mobile (please complete the following information)

Additional information

nirvn commented 5 months ago

@agseaton , have you tried with the latest QField 3.3 version? A couple of bugs were fixed with relations with cardinal configuration.

github-actions[bot] commented 4 months ago

The QField project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale". If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue. In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue. If there is no further activity on this issue, it will be closed in a week.

agseaton commented 2 months ago

Sorry for not getting back to you earlier on this.

I've tested it out with the example project provided above and QField 3.4, and I'm still seeing the issues I described.