Skip to content
Permalink
Browse files

Get pk attributes from layer instead of provider

  • Loading branch information
mhugent committed Dec 27, 2018
1 parent 69de8f9 commit 10cbad7769ff17cab100b521bd5e8b82307f9d65
Showing with 2 additions and 8 deletions.
  1. +2 −8 src/server/services/wms/qgswmsrenderer.cpp
@@ -395,14 +395,8 @@ namespace QgsWms
throw QgsBadRequestException( QStringLiteral( "AtlasPrintError" ),
QStringLiteral( "The atlas has no coverage layer" ) );
}
QgsVectorDataProvider *cProvider = cLayer->dataProvider();
if ( !cProvider )
{
throw QgsBadRequestException( QStringLiteral( "AtlasPrintError" ),
QStringLiteral( "An error occured during the Atlas print" ) );
}

QgsAttributeList pkIndexes = cProvider->pkAttributeIndexes();
QgsAttributeList pkIndexes = cLayer->primaryKeyAttributes();
if ( pkIndexes.size() < 1 )
{
throw QgsBadRequestException( QStringLiteral( "AtlasPrintError" ),
@@ -411,7 +405,7 @@ namespace QgsWms
QStringList pkAttributeNames;
for ( int i = 0; i < pkIndexes.size(); ++i )
{
pkAttributeNames.append( cProvider->fields()[pkIndexes.at( i )].name() );
pkAttributeNames.append( cLayer->fields()[pkIndexes.at( i )].name() );
}

int nAtlasFeatures = atlasPk.size() / pkIndexes.size();

0 comments on commit 10cbad7

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