Fix shifted joined attributes when join field is repeated (fixes #12589)

This commit is contained in:
Martin Dobias 2015-06-18 21:15:34 +08:00
parent 03aa1e7e27
commit 78708159b2

View File

@ -237,7 +237,8 @@ void QgsVectorLayerJoinBuffer::updateFields( QgsFields& fields )
continue;
//skip the join field to avoid double field names (fields often have the same name)
if ( joinFields[idx].name() != joinFieldName )
// when using subset of field, use all the selected fields
if ( hasSubset || joinFields[idx].name() != joinFieldName )
{
QgsField f = joinFields[idx];
f.setName( prefix + f.name() );