Bug report #21366

Expression with square bracket for maps are not evaluated in a layout label

Added by Etienne Trimaille over 5 years ago. Updated over 5 years ago.

Status:Closed
Priority:Normal
Assignee:Nyall Dawson
Category:Expressions
Affected QGIS version:3.7(master) Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:29183

Description

I have this expression:

map('a', 1, 'b', 2)['a']

which works well in the expression dialog.
But if the expression is in a layout label, then it doesn't work:

[%map('a', 1, 'b', 2)['a']%]

The expression is displayed in the label instead of getting evaluated.

Only this one works:

[%map_get(map('a', 1, 'b', 2),'a')%]

Associated revisions

Revision cab2dcf6
Added by Nyall Dawson over 5 years ago

Fix regex used to replace [% %] expressions in text

Was incorrectly truncating at first ']' character

Fixes #21366

Revision d966d9c7
Added by Nyall Dawson over 5 years ago

Fix regex used to replace [% %] expressions in text

Was incorrectly truncating at first ']' character

Fixes #21366

(cherry picked from commit cab2dcf62cedad069ea64c379efcdc2f258adcd0)

Revision 1ef89f2b
Added by Nyall Dawson over 5 years ago

Fix regex used to replace [% %] expressions in text

Was incorrectly truncating at first ']' character

Fixes #21366

(cherry picked from commit cab2dcf62cedad069ea64c379efcdc2f258adcd0)

History

#1 Updated by Nyall Dawson over 5 years ago

  • Assignee set to Nyall Dawson
  • Status changed from Open to In Progress

#2 Updated by Nyall Dawson over 5 years ago

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

Also available in: Atom PDF