Skip to content

Commit 43caf02

Browse files
committed
Make sure updateFields() is called before setDisplayField for new vector layers (fix #8311)
1 parent 6b21b86 commit 43caf02

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/core/qgsvectorlayer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,6 @@ QgsVectorLayer::QgsVectorLayer( QString vectorLayerPath,
147147
// Always set crs
148148
setCoordinateSystem();
149149

150-
mJoinBuffer = new QgsVectorLayerJoinBuffer();
151-
152-
updateFields();
153-
154150
// check if there is a default style / propertysheet defined
155151
// for this layer and if so apply it
156152
bool defaultLoadedFlag = false;
@@ -1632,6 +1628,10 @@ bool QgsVectorLayer::setDataProvider( QString const & provider )
16321628
// get and store the feature type
16331629
mWkbType = mDataProvider->geometryType();
16341630

1631+
mJoinBuffer = new QgsVectorLayerJoinBuffer();
1632+
1633+
updateFields();
1634+
16351635
// look at the fields in the layer and set the primary
16361636
// display field using some real fuzzy logic
16371637
setDisplayField();

0 commit comments

Comments
 (0)