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

@parent not linked to the correct feature when looping through layer #23693

Closed
qgib opened this issue Oct 27, 2016 · 2 comments
Closed

@parent not linked to the correct feature when looping through layer #23693

qgib opened this issue Oct 27, 2016 · 2 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Expressions Related to the QGIS expression engine or specific expression functions
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Oct 27, 2016

Author Name: Mathieu Pellerin - nIRV (Mathieu Pellerin - nIRV)
Original Redmine Issue: 15771
Affected QGIS version: master
Redmine category:expressions
Assignee: Matthias Kuhn


While testing out the cool new @parent variable for the aggregate() function, I noticed the @parent variable doesn't get assigned to the correct feature when looping through a layer (as part of labelling or symbology rendering). I've attached a small test project which demonstrate the issue.

Steps to reproduce

  1. Open the parent.qgs test project
  2. Take note of the label over the two orange areas
  3. It should be showing the number of overlapping points, which it does properly only for the first feature (i.e. 3), while the second feature also shows 3 when it should show 2.
  4. The labels' second line show the @parent COMM_CODE value, which shows the wrong one for the second feature (it should be 123456, and instead it prints 12345)

@qgib
Copy link
Contributor Author

qgib commented Oct 30, 2016

Author Name: Mathieu Pellerin - nIRV (Mathieu Pellerin - nIRV)


This commit (#7a05a7a8c4b9184f6cad7d155b6714076b1dccd9) improved things (i.e. @parent's caching works, so is $geometry's), but caching is still not updated for "fields" in the filter clause.

I'm attaching an updated test project, which labels two polygons using three aggregate calls, the third one being built on a "field" = attribute(@parent,"parent_field) which fails for the 2nd polygon. The failure is due to "field" not being updated with the 2nd polygon's values.


  • done_ratio was changed from 0 to 50
  • 10505 was configured as parent_v2.zip

@qgib
Copy link
Contributor Author

qgib commented Oct 31, 2016

Author Name: Anónimo (Anónimo)


Fixed in changeset "e7333f68145f27a74aacd8f75939623e37fc4510".


  • status_id was changed from Open to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Expressions Related to the QGIS expression engine or specific expression functions labels May 25, 2019
@qgib qgib added this to the Version 3.0 milestone May 25, 2019
@qgib qgib closed this as completed May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Expressions Related to the QGIS expression engine or specific expression functions
Projects
None yet
Development

No branches or pull requests

1 participant