Bug report #12090
QGIS Server: getFeature expression does not work
|Affected QGIS version:||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 #:||20286|
It seems like in current master the attribute(getFeature()) expression does not work in a maptip.
I used the following maptip on layer "Langsamverkehrszonen":
<p><strong>[% "objekt_projektbezeichnung" ]</strong><br/>
Status: [ attribute(getFeature('Status Begegnungszone', 'code', status_t30_begegnungszone),'wert')%]
The attribute(getFeature()) expression works fine in QGIS desktop, but does not work in QGIS server. QGIS server does not correctly evaluate the expression.
#4 Updated by Marco Hugentobler almost 6 years ago
- File feature_info.png added
I tested it here, however it seems to work here (unless I overlooked something). E.g. doing a featureinfo at the green polygon of the attached screenshot returns: 'Tempo 30 Zone Brunnenwiesenstrasse
Status: bestehend, in Betrieb Inbetriebnahme: 2012' as maptip field. Isn't this the expected outcome?
#6 Updated by Marco Hugentobler almost 6 years ago
It is probably because I loaded the whole group as WMS layer into QGIS. If you load only 'Langsamverkehrszonen', it will not work, because QGIS cannot know about the two layers in Hilfstabellen.
The correct approach in the server would be to check that before the request (as it is done for joins and value relations). Difficulty is that the expression can be anywhere, not only in the displayfield.