Skip to content

Commit

Permalink
Fix OGC test getfeatureinfo:invalid-query_layers
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Sep 29, 2017
1 parent e06ec71 commit 54137b7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/server/services/wms/qgswmsrenderer.cpp
Expand Up @@ -1255,10 +1255,13 @@ namespace QgsWms

Q_FOREACH ( QString queryLayer, queryLayers )
{
bool validLayer = false;
Q_FOREACH ( QgsMapLayer *layer, layers )
{
if ( queryLayer == layerNickname( *layer ) )
{
validLayer = true;

QDomElement layerElement;
if ( infoFormat == QgsWmsParameters::Format::GML )
{
Expand Down Expand Up @@ -1316,6 +1319,12 @@ namespace QgsWms
break;
}
}

if ( !validLayer )
{
throw QgsBadRequestException( QStringLiteral( "LayerNotDefined" ),
QStringLiteral( "Layer '%1' not found" ).arg( queryLayer ) );
}
}

if ( featuresRect )
Expand Down

0 comments on commit 54137b7

Please sign in to comment.