Bug report #19063

Unable to retrieve variables from another layout item

Added by Harrissou Santanna about 2 years ago. Updated about 2 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Map Composer/Printing
Affected QGIS version:3.1(master) Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:26893

Description

According to the function help and documentation map_get(item_variables('Map 1'), 'map_scale') would help me retrieve the scale of a map item and use it for example in a label. This does no longer work unless I manually set the Item ID property of the map item, using only digits (eg. 1 or 124).
I'm not sure it makes sense and it's a nice UX to have for example my map named 1 instead of Map1 or my local map...
Using e7da103

DEPARTEMENT.7z (937 KB) Harrissou Santanna, 2018-06-04 02:39 PM

item_variables.qgz (5.32 KB) Harrissou Santanna, 2018-06-04 02:44 PM

item_variables.PNG (83.3 KB) Harrissou Santanna, 2018-06-04 02:44 PM

Associated revisions

Revision 57c442a4
Added by Nyall Dawson about 2 years ago

[layouts] Fix item_variables function with non-lowercase item ids

Fixes #19063

History

#1 Updated by Nyall Dawson about 2 years ago

  • Status changed from Open to Feedback

This works fine for me (and there's multiple unit tests protecting this) - can you attach a sample project?

Note that no items have an id by default - you always need to manually set ids.

#2 Updated by Harrissou Santanna about 2 years ago

  • File DEPARTEMENT.7z added
  • File item_variables.PNG added
  • File item_variables.qgz added

Nyall Dawson wrote:

Note that no items have an id by default - you always need to manually set ids.

Then what does represent the "Map 1", "Map 2" texts that appear at the top of the map item properties, and replaced by the "Item ID" when set? aren't they some kind of default internal IDs? Should they not be used for such a feature?

can you attach a sample project?

Done (project, data and screenshot).

#3 Updated by Harrissou Santanna about 2 years ago

  • File deleted (item_variables.PNG)

#4 Updated by Harrissou Santanna about 2 years ago

  • File deleted (item_variables.qgz)

#5 Updated by Harrissou Santanna about 2 years ago

Added new files as there was an error in what i previously sent

#6 Updated by Nyall Dawson about 2 years ago

  • % Done changed from 0 to 100
  • Status changed from Feedback to Closed

Also available in: Atom PDF