Skip to content

Commit

Permalink
Fix incorrect result when calling changeAttributeValues on a non-edit…
Browse files Browse the repository at this point in the history
…able layer
  • Loading branch information
nyalldawson committed Nov 18, 2022
1 parent b1e63a2 commit adacd9a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/vector/qgsvectorlayer.cpp
Expand Up @@ -3185,9 +3185,12 @@ bool QgsVectorLayer::changeAttributeValues( QgsFeatureId fid, const QgsAttribute
result = mJoinBuffer->changeAttributeValues( fid, newValuesJoin, oldValuesJoin );
}

if ( ! newValuesNotJoin.isEmpty() && mEditBuffer && mDataProvider )
if ( ! newValuesNotJoin.isEmpty() )
{
result &= mEditBuffer->changeAttributeValues( fid, newValuesNotJoin, oldValues );
if ( mEditBuffer && mDataProvider )
result &= mEditBuffer->changeAttributeValues( fid, newValuesNotJoin, oldValues );
else
result = false;
}

if ( result && !skipDefaultValues && !mDefaultValueOnUpdateFields.isEmpty() )
Expand Down

0 comments on commit adacd9a

Please sign in to comment.