Bug report #21077

Form Value relation based on WFS layer

Added by Lene Fischer 12 months ago. Updated 12 months ago.

Status:Closed
Priority:Normal
Assignee:Alessandro Pasotti
Category:Web Services clients/WFS
Affected QGIS version:3.5(master) Regression?:No
Operating System:Any Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:28895

Description

I´m trying to set up a form value relation using a connection based on WFS.

The problem is that the filter expression for field “elementer” in layer “v_greg_flader” : current_value('hovedelement_kode') = "hovedelement_kode" doesn’t return any values to the drop-down widget although there is matching values for “hovedelement_kode” in layer “d_basis_hovedelementer” for all possible values of the same field in Layer “d_basis_elementer”

• All layers are based on WFS

• Layer “v_greg_flader” is the main layer, which contains (among others) the fields “hovedelement_kode” and “element_kode”
• Layer “d_basis_hovedelementer” contains lookup values for field “hovedelement_kode” in layer “v_greg_flader”

• Layer “d_basis_hovedelementer” contains lookup values for field “element_kode” in layer “v_greg_flader”

• There is a 1:n relation between “d_basis_hovedelementer” and “d_basis_elementer” on common field “hovedelement_kode”

Can you help look into this problem. Attached is a project illustrating the problem.
Regards
Lene

alessandro.qgs (56.6 KB) Lene Fischer, 2019-01-23 11:35 AM

Associated revisions

Revision 38f05b59
Added by Alessandro Pasotti 12 months ago

Fix WFS context fields variable

because the fields in the (spatialite) cached
iterator are not the same as the main iterator.

Fix #21077 - Form Value relation based on WFS layer (nothing to do with
value relations)

History

#1 Updated by Bo Thomsen 12 months ago

All version of QGIS 3.x is affected by this problem

#2 Updated by Alessandro Pasotti 12 months ago

  • Operating System changed from Windows to Any
  • Category changed from Forms to Web Services clients/WFS
  • Status changed from Open to In Progress
  • Affected QGIS version changed from 3.4.4 to 3.5(master)

#3 Updated by Alessandro Pasotti 12 months ago

  • Pull Request or Patch supplied changed from No to Yes

PR https://github.com/qgis/QGIS/pull/8970 (it turned out that it has nothing to do with forms nor value relations)

#4 Updated by Alessandro Pasotti 12 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

#5 Updated by Giovanni Manghi 12 months ago

  • Resolution set to fixed/implemented

#6 Updated by Bo Thomsen 12 months ago

Hey Alesandro -

It works as a charm in 3.5 :-)

Will the fix be backported to 3.4 (LTR) ??

#7 Updated by Alessandro Pasotti 12 months ago

Yes: see the "backport" tag in https://github.com/qgis/QGIS/pull/8970

Also available in: Atom PDF