-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2.18LTR] Fix field calculator in not able to add a new field #7375
Conversation
…cified length/width (this is the default in QgsField constructor and QgsVectorDataProvider::NativeType())
…precision against min/max if they are defined (ie > 0). Fixes test_qgsauxiliarystorage.py and qgis_projectstoragetest
failure seems unrelated to these changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
QgsDebugMsgLevel( QString( "field name = %1 type = %2 length = %3 precision = %4" ) | ||
.arg( field.name(), | ||
QVariant::typeToName( field.type() ) ) | ||
.arg( field.length() ) | ||
.arg( field.precision() ), 2 ); | ||
for ( i = 0; i < mNativeTypes.size(); i++ ) | ||
Q_FOREACH ( const NativeType &nativeType, mNativeTypes ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you use a range loop here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry, this is 2.18 forget my comment.
Description
This should to fix the regression issue #19283 raised since 033071a (which must not be reverted). The PR is basically a backport of 00c301e and e715b91.
Also, set 0 as default precision on field definition if not defined from the user in order to avoid to define precision for string or datetime type.
Commit 6e45069 can be applied to master branch too.
Sorry I cannot build a 2.18 branch on my machine right now so please test before merging (if it looks good to you).
Checklist
fixes #11111
in the commit message next to the description[FEATURE]
in the commit message[needs-docs]
in the commit message and contain sufficient information in the commit message to be documentedscripts/prepare-commit.sh
script before each commit