Skip to content
Permalink
Browse files

Fix server virtual layers load

  • Loading branch information
elpaso committed Nov 5, 2020
1 parent 47a08a4 commit bd5e408dd31c97bf54bb015e26ed3638fdc8e23d
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 );

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

}

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

0 comments on commit bd5e408

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