Expressions like aggregate
or layer_property
use QgsProject().instance() instead of the expression context's project
#27857
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
Feedback
Waiting on the submitter for answers
stale
Uh oh! Seems this work is abandoned, and the PR is about to close.
Author Name: Olivier Dalang (@olivierdalang)
Original Redmine Issue: 20035
Affected QGIS version: 3.3(master)
Redmine category:expressions
Hi !
I'm writing a python algorithm for the processing framework allowing to export PDFs. This requires instantiating a QgsProject and accessing it's layouts without actually loading the QgsProject in the UI.
In the layouts, it seems the @aggregate@, @layer_property@ and similar methods refer to the loaded QgsProject instead of the QgsProject to which the layout belongs.
I think the bug is in @QgsExpressionUtils.h:341@, where @QgsProject.instance()@ is used, instead of the expression context's project.
Cheers,
Olivier
The text was updated successfully, but these errors were encountered: