Skip to content

Commit

Permalink
[processing] "Order by expression" needs to regenerate fid
Browse files Browse the repository at this point in the history
  • Loading branch information
agiudiceandrea authored and github-actions[bot] committed Feb 4, 2025
1 parent 5c3959c commit 55f984c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/analysis/processing/qgsalgorithmorderbyexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ QString QgsOrderByExpressionAlgorithm::shortHelpString() const
"which is available in the expression builder." );
}

Qgis::ProcessingAlgorithmDocumentationFlags QgsOrderByExpressionAlgorithm::documentationFlags() const
{
return Qgis::ProcessingAlgorithmDocumentationFlag::RegeneratesPrimaryKey;
}

QgsOrderByExpressionAlgorithm *QgsOrderByExpressionAlgorithm::createInstance() const
{
return new QgsOrderByExpressionAlgorithm();
Expand All @@ -82,7 +87,7 @@ QVariantMap QgsOrderByExpressionAlgorithm::processAlgorithm( const QVariantMap &
const bool nullsFirst = parameterAsBoolean( parameters, QStringLiteral( "NULLS_FIRST" ), context );

QString sinkId;
std::unique_ptr<QgsFeatureSink> sink( parameterAsSink( parameters, QStringLiteral( "OUTPUT" ), context, sinkId, source->fields(), source->wkbType(), source->sourceCrs() ) );
std::unique_ptr<QgsFeatureSink> sink( parameterAsSink( parameters, QStringLiteral( "OUTPUT" ), context, sinkId, source->fields(), source->wkbType(), source->sourceCrs(), QgsFeatureSink::RegeneratePrimaryKey ) );
if ( !sink )
throw QgsProcessingException( invalidSinkError( parameters, QStringLiteral( "OUTPUT" ) ) );

Expand Down
1 change: 1 addition & 0 deletions src/analysis/processing/qgsalgorithmorderbyexpression.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class QgsOrderByExpressionAlgorithm : public QgsProcessingAlgorithm
QString group() const override;
QString groupId() const override;
QString shortHelpString() const override;
Qgis::ProcessingAlgorithmDocumentationFlags documentationFlags() const override;
QgsOrderByExpressionAlgorithm *createInstance() const override SIP_FACTORY;

protected:
Expand Down

0 comments on commit 55f984c

Please sign in to comment.