Skip to content
Permalink
Browse files

restore old code

  • Loading branch information
3nids committed Sep 15, 2020
1 parent c738609 commit 834bcc79c2ec31ec29b825bbce55fe63d4850e15
Showing with 19 additions and 6 deletions.
  1. +19 −6 src/server/services/wfs/qgswfsgetfeature.cpp
@@ -259,13 +259,10 @@ namespace QgsWfs
// build corresponding propertyname
QList<QString> propertynames;
QList<QString> fieldnames;
for ( int idx = 0; idx < fields.count(); ++idx )
for ( const QgsField &field : fields )
{
if ( !fields.at( idx ).configurationFlags().testFlag( QgsField::ConfigurationFlag::ExposeViaWfs ) )
continue;

fieldnames.append( fields[idx].name() );
propertynames.append( fields.field( idx ).name().replace( ' ', '_' ).replace( cleanTagNameRegExp, QString() ) );
fieldnames.append( field.name() );
propertynames.append( field.name().replace( ' ', '_' ).replace( cleanTagNameRegExp, QString() ) );
}
QString fieldName;
for ( plstIt = propertyList.constBegin(); plstIt != propertyList.constEnd(); ++plstIt )
@@ -291,6 +288,22 @@ namespace QgsWfs
}
}

//excluded attributes for this layer
if ( !attrIndexes.isEmpty() )
{
for ( const QgsField &field : fields )
{
if ( !field.configurationFlags().testFlag( QgsField::ConfigurationFlag::ExposeViaWfs ) )
{
int fieldNameIdx = fields.indexOf( field.name() );
if ( fieldNameIdx > -1 && attrIndexes.contains( fieldNameIdx ) )
{
attrIndexes.removeOne( fieldNameIdx );
}
}
}
}

// update request
QgsFeatureRequest featureRequest = query.featureRequest;

0 comments on commit 834bcc7

Please sign in to comment.
You can’t perform that action at this time.