Skip to content

Commit

Permalink
[Backport release-3_10] Fix server virtual layers load
Browse files Browse the repository at this point in the history
Manual backport of #39819
  • Loading branch information
elpaso authored and nyalldawson committed Dec 2, 2020
1 parent 84a15cd commit 8145b3b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/server/qgsconfigcache.cpp
Expand Up @@ -44,6 +44,8 @@ const QgsProject *QgsConfigCache::project( const QString &path, QgsServerSetting
if ( ! mProjectCache[ path ] )
{
std::unique_ptr<QgsProject> prj( new QgsProject() );
// This is required by virtual layers that call QgsProject::instance() inside the constructor :(
QgsProject::setInstance( prj.get() );
QgsStoreBadLayerInfo *badLayerHandler = new QgsStoreBadLayerInfo();
prj->setBadLayerHandler( badLayerHandler );
if ( prj->read( path ) )
Expand Down

0 comments on commit 8145b3b

Please sign in to comment.