Bug report #20035
Expressions like `aggregate` or `layer_property` use QgsProject().instance() instead of the expression context's project
|Affected QGIS version:||3.3(master)||Regression?:||No|
|Operating System:||Windows 10||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||27857|
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
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
QgsProject.instance() is used, instead of the expression context's project.