Skip to content
Permalink
Browse files

Merge pull request #6522 from mhugent/fix_18247

Fallback to feature id if pk attribute is not there
  • Loading branch information
mhugent committed Mar 9, 2018
2 parents 45f04b7 + b0d3548 commit 188ca9acec347f3d63be0803cfd4223b992de53c
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/server/qgsowsserver.cpp
@@ -85,7 +85,13 @@ QString QgsOWSServer::featureGmlId( const QgsFeature* f, const QgsAttributeList&
{
pkId.append( pkSeparator() );
}
pkId.append( f->attribute( *it ).toString() );

QVariant pkAttribute = f->attribute( *it );
if ( !pkAttribute.isValid() )
{
return QString::number( f->id() );
}
pkId.append( pkAttribute.toString() );
}
return pkId;
}

0 comments on commit 188ca9a

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