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 authored and github-actions[bot] committed Nov 18, 2022
1 parent ecfa173 commit 93084f9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/vector/qgsvectorlayer.cpp
Expand Up @@ -3153,9 +3153,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 93084f9

Please sign in to comment.