Bug report #22071

Relation reference widget wrong feature when "on map identification"

Added by matteo ghetta 5 months ago. Updated 5 months ago.

Status:Closed
Priority:High
Assignee:Alessandro Pasotti
Category:Edit widget
Affected QGIS version:3.4.6 Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:29884

Description

If confirmed I think something is really weird. In attach the complete project.

  • line layer with ID field
  • table layer with FK field
  • 1:N relation between line ID (parent) and table FK (child)
  • table FK widget type set (automatically) as "relation reference" and the "On map identification" checkbox checked
  • adding a line in the table layer and clicking on the "identify on map" button
  • the FK field of the table layer is set to line layer ID - 1 (so when the line ID is 2 the FK of the table is 1)

Verified with the same project in QGIS 3.4.6 and master

project.zip (8.71 KB) matteo ghetta, 2019-05-14 09:51 AM

ksnip_20190520-135720.png (84 KB) matteo ghetta, 2019-05-20 02:16 PM

ezgif.com-video-to-gif.gif (118 KB) matteo ghetta, 2019-05-21 10:59 AM

Associated revisions

Revision 2b14dacd
Added by Alessandro Pasotti 5 months ago

Fix identify on map in relation reference widget

Fixes #22071 - Relation reference widget wrong feature when "on map identification"

History

#1 Updated by Alessandro Pasotti 5 months ago

  • Status changed from Open to Feedback

I searched the whole code base but I cannot find any button labeled with "identify on map", let alone that I don't get how you can identify on map a table layer feature which has no geometry.

Can you please clarify?

#2 Updated by matteo ghetta 5 months ago

Yep, see attached image.

#3 Updated by Alessandro Pasotti 5 months ago

I said: "I cannot find any button labeled with "identify on map""

not that I cannot find the options to set "On map identification"

#4 Updated by matteo ghetta 5 months ago

I'm trying to identify geometric object FROM a geometryless table. I thought it make sense: if I want to identify a geometric pipe that belongs to a not spatial worker.

#5 Updated by Giovanni Manghi 5 months ago

I'm also struggling to understand what is the issue and how replicate it.

#6 Updated by matteo ghetta 5 months ago

OK I try to be more clear:

  • open the attached project
  • a 1:N relation is already set up: Parent = `Condotte` Field = `ID`, Child = `operai` Field = `FK`
  • the labels on the condotte layers are taken from ID field
  • select `operai` and enter in the editing mode
  • add another row in the table and, instead of entering manually in the FK field the ID of the condotte layer, click on the `On map identification` button
  • when clicking on, for example, condotte with label (and ID) = 2, the FK field is filled with 1 (ID - 1). Therefore the relation is wrong

A gif in attach

#7 Updated by Giovanni Manghi 5 months ago

matteo ghetta wrote:

OK I try to be more clear:

  • open the attached project
  • a 1:N relation is already set up: Parent = `Condotte` Field = `ID`, Child = `operai` Field = `FK`
  • the labels on the condotte layers are taken from ID field
  • select `operai` and enter in the editing mode
  • add another row in the table and, instead of entering manually in the FK field the ID of the condotte layer, click on the `On map identification` button
  • when clicking on, for example, condotte with label (and ID) = 2, the FK field is filled with 1 (ID - 1). Therefore the relation is wrong

A gif in attach

Hi Matteo the gif is tiny, is not possible to read/see anything in it.

#8 Updated by matteo ghetta 5 months ago

OK here the link to the vieo that can be downloaded:

https://www.faunalia.eu/~matteo/qgis_bug/

#9 Updated by Alessandro Pasotti 5 months ago

  • Assignee set to Alessandro Pasotti
  • Status changed from Feedback to Open

#10 Updated by Alessandro Pasotti 5 months ago

  • Status changed from Open to In Progress
  • Pull Request or Patch supplied changed from No to Yes
  • Resolution set to fixed/implemented

#11 Updated by Alessandro Pasotti 5 months ago

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

Also available in: Atom PDF