mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-10 00:13:55 -04:00
Fix QgsExpressionNodeColumnRef::prepareNode
Look also for the attribute in the feature, as it is done by evalNode()
This commit is contained in:
parent
809196693c
commit
ee980ca06f
@ -1261,16 +1261,18 @@ bool QgsExpressionNodeColumnRef::prepareNode( QgsExpression *parent, const QgsEx
|
||||
QgsFields fields = qvariant_cast<QgsFields>( context->variable( QgsExpressionContext::EXPR_FIELDS ) );
|
||||
|
||||
mIndex = fields.lookupField( mName );
|
||||
if ( mIndex >= 0 )
|
||||
|
||||
if ( mIndex == -1 && context->hasFeature() )
|
||||
{
|
||||
return true;
|
||||
mIndex = context->feature().fieldNameIndex( mName );
|
||||
}
|
||||
else
|
||||
|
||||
if ( mIndex == -1 )
|
||||
{
|
||||
parent->setEvalErrorString( tr( "Column '%1' not found" ).arg( mName ) );
|
||||
mIndex = -1;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
QString QgsExpressionNodeColumnRef::dump() const
|
||||
|
Loading…
x
Reference in New Issue
Block a user