Skip to content

Commit df15e03

Browse files
authored
Merge pull request #4864 from opengisch/improve_error_message_with_attr_type_mismatch
Improve error message on value not compatible with attribute type
2 parents c62406c + d2d1893 commit df15e03

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

vcpkg/overlay/qgis-qt6/portfile.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ vcpkg_from_github(
1717
bigobj.patch
1818
poly2tri.patch
1919
mesh.patch
20+
wrongattributeerrormessage.patch
2021
)
2122

2223
file(REMOVE ${SOURCE_PATH}/cmake/FindQtKeychain.cmake)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/src/core/providers/ogr/qgsogrprovider.cpp b/src/core/providers/ogr/qgsogrprovider.cpp
2+
index 8b0ac5a4cc9..c8890ebd36d 100644
3+
--- a/src/core/providers/ogr/qgsogrprovider.cpp
4+
+++ b/src/core/providers/ogr/qgsogrprovider.cpp
5+
@@ -1738,7 +1738,7 @@ bool QgsOgrProvider::addFeaturePrivate( QgsFeature &f, Flags flags, QgsFeatureId
6+
7+
if ( !ok )
8+
{
9+
- pushError( tr( "wrong data type for attribute %1 of feature %2: %3" ).arg( qgisAttributeId ) .arg( f.id() ).arg( qType ) );
10+
+ pushError( tr( "Could not convert value for attribute \"%1\" to type %2" ).arg( mAttributeFields.at( qgisAttributeId ).name(), OGR_GetFieldTypeName( type ) ) );
11+
returnValue = false;
12+
}
13+
}

0 commit comments

Comments
 (0)