Skip to content

Commit

Permalink
Add all applicable scopes for editor widget constraint validation
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Sep 9, 2016
1 parent 2e97153 commit 9626f58
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/gui/editorwidgets/core/qgseditorwidgetwrapper.cpp
Expand Up @@ -117,11 +117,9 @@ void QgsEditorWidgetWrapper::updateConstraint( const QgsFeature &ft )
{
description = layer()->editFormConfig().expressionDescription( mFieldIdx );

QgsExpressionContext context =
QgsExpressionContextUtils::createFeatureBasedContext( ft, ft.fields() );
context << QgsExpressionContextUtils::layerScope( layer() );

QgsExpressionContext context = layer()->createExpressionContext();
context.setFeature( ft );

QgsExpression expr( expression );

mValidConstraint = expr.evaluate( &context ).toBool();
Expand Down

0 comments on commit 9626f58

Please sign in to comment.