Skip to content
Permalink
Browse files

Fix server virtual layers load

(cherry picked from commit bd5e408)
  • Loading branch information
elpaso authored and nyalldawson committed Dec 21, 2020
1 parent d8fe6b3 commit 46e94523a499322f7bb1afbea5171511867db080
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/server/qgsconfigcache.cpp
@@ -43,8 +43,12 @@ 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 );

@@ -114,7 +118,6 @@ const QgsProject *QgsConfigCache::project( const QString &path, QgsServerSetting
}
}
return mProjectCache[ path ];

}

QDomDocument *QgsConfigCache::xmlDocument( const QString &filePath )

0 comments on commit 46e9452

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