Bug report #17261

Value relation widget update incorrectly tries to use value instead of key

Added by Tim Sutton about 7 years ago. Updated almost 7 years ago.

Status:Closed
Priority:Normal
Assignee:Matthias Kuhn
Category:Relations
Affected QGIS version:master Regression?:No
Operating System:MacOS Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:25159

Description

I am having a problem using the value relation widget in QGIS 2.99999 / master. Here is my simple scenario:

The intention is to show the trail_section table (which has a geometry column) and include in it various properties from the trail table (for line colour and so on). I set up my relations like this:

The table form view shows the trail name instead of the trail_id nicely but whenever I click on a record, the label turns red and I get the following error whenever I try to commit:

From the error message I can see that it is trying to update the trail_section.trail_id with the value of the trail relation rather than the key.

schema.png (20.8 KB) Tim Sutton, 2017-10-08 10:37 PM

error.png (48.2 KB) Tim Sutton, 2017-10-08 10:40 PM

trail_section.png (509 KB) Tim Sutton, 2017-10-08 10:40 PM

trail.png (673 KB) Tim Sutton, 2017-10-08 10:40 PM

Associated revisions

Revision 032ca68b
Added by Matthias Kuhn almost 7 years ago

Merge pull request #5572 from signedav/valuerelationwidget

Value relation widget takes key again instead of value (in Attribute Form)

Fix #17261

History

#1 Updated by Giovanni Manghi about 7 years ago

  • Status changed from Open to Feedback

Works as expected on QGIS LTR?

#2 Updated by Tim Sutton about 7 years ago

Hi Giovanni. Yes I tested and the same procedure seems to work in 2.18 but not in QGIS 3. I will go and triple check that I followed the same workflow and report back here if it was my fault :-P

#3 Updated by Giovanni Manghi about 7 years ago

  • Status changed from Feedback to Open

#4 Updated by Anonymous almost 7 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF