Skip to content

Commit

Permalink
Actually use the "isNewField" flag
Browse files Browse the repository at this point in the history
  • Loading branch information
suricactus committed Sep 11, 2020
1 parent d32369f commit 33a6472
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/analysis/processing/qgsalgorithmfieldcalculator.cpp
Expand Up @@ -124,7 +124,7 @@ bool QgsFieldCalculatorAlgorithm::prepareAlgorithm( const QVariantMap &parameter

QVariant::Type fieldType = fieldTypes[fieldTypeIdx];

// this is to keep backwards compatibility.
// this is to keep backwards compatibility, "NEW_FIELD" flags what how "FIELD_NAME" should be treated
// In a perfect universe there would be only "EXISTING_FIELD_NAME" and "NEW_FIELD_NAME"
if ( !parameters.contains( QStringLiteral( "NEW_FIELD" ) ) )
{
Expand All @@ -147,7 +147,7 @@ bool QgsFieldCalculatorAlgorithm::prepareAlgorithm( const QVariantMap &parameter

int fieldIdx = mFields.lookupField( field.name() );

if ( fieldIdx < 0 )
if ( isNewField || fieldIdx < 0 )
mFields.append( field );

QString dest;
Expand Down

0 comments on commit 33a6472

Please sign in to comment.