mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
When evaluating an expression with a missing referenced field, this will be replaced with [fieldname].
When calculating data defined values, this will be counterproductive. A field with a data defined value might work well in the expression builder (because fiels are all present) but fail in the legend, because it's rendered with no feature and hence fields. With this change, we can at least use `try("fieldname", 0)` to fallback to a default value.
This commit is contained in:
parent
3bf8d96ad3
commit
e1b016bc2b
@ -1270,7 +1270,8 @@ QVariant QgsExpressionNodeColumnRef::evalNode( QgsExpression *parent, const QgsE
|
||||
return feature.attribute( mName );
|
||||
}
|
||||
}
|
||||
return QVariant( '[' + mName + ']' );
|
||||
parent->setEvalErrorString( QStringLiteral( "Column '%1' not found" ).arg( mName ) );
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
QgsExpressionNode::NodeType QgsExpressionNodeColumnRef::nodeType() const
|
||||
|
Loading…
x
Reference in New Issue
Block a user