Skip to content
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

Merged
merged 6 commits into from
Jul 15, 2018

Conversation

slarosa
Copy link
Member

@slarosa slarosa commented Jul 6, 2018

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

Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.

  • Commit messages are descriptive and explain the rationale for changes
  • Commits which fix bugs include fixes #11111 in the commit message next to the description
  • Commits which add new features are tagged with [FEATURE] in the commit message
  • Commits which change the UI or existing user workflows are tagged with [needs-docs] in the commit message and contain sufficient information in the commit message to be documented
  • I have read the QGIS Coding Standards and this PR complies with them
  • This PR passes all existing unit tests (test results will be reported by travis-ci after opening this PR)
  • New unit tests have been added for core changes
  • I have run the scripts/prepare-commit.sh script before each commit

slarosa and others added 4 commits July 6, 2018 13:23
…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
@nyalldawson nyalldawson added this to the 2.18.22 milestone Jul 7, 2018
@nyalldawson nyalldawson requested a review from elpaso July 7, 2018 00:42
@slarosa
Copy link
Member Author

slarosa commented Jul 10, 2018

failure seems unrelated to these changes.

@m-kuhn m-kuhn changed the title [2.18LTR] Fix #19283 [2.18LTR] Fix field calculator in not able to add a new field Jul 13, 2018
Copy link
Contributor

@elpaso elpaso left a 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 )
Copy link
Contributor

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?

Copy link
Contributor

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.

@slarosa slarosa merged commit 0d0adfe into qgis:release-2_18 Jul 15, 2018
@slarosa slarosa deleted the fix_19283 branch October 12, 2020 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants