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

invalid entry in Quick Field Calculation Bar results in NULL value without warning #47385

Closed
2 tasks done
Jeroen-GroeneBij opened this issue Feb 16, 2022 · 1 comment · Fixed by #54815
Closed
2 tasks done
Assignees
Labels
Attribute Table Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption

Comments

@Jeroen-GroeneBij
Copy link

What is the bug or the crash?

When using the Quick Field Calculation Bar in the Attribute table, updating an existing text field with a text value without using single quotes, result in updating the field with NULL value without any warning.
Doing the same in the Field Calculator will show an error message and updating is not possible.

Steps to reproduce the issue

See attached zip or:
Create a new scratch layer (points) with a text field named testfield
Create a few points and add m2 as value

Open the attribute table and use the Quick Field Calculation bar to update testfield
Type m1 without using single quotes
Now the Update All button is available. Clicking it results in NULL value for testfield without any warning. This is also inconsistent compared to using the Field Calculator. See comment for feature request issue reference.

test_qfcb.zip

Versions

<style type="text/css"> p, li { white-space: pre-wrap; } </style>
QGIS-versie 3.22.3-Białowieża QGIS code revisie 1628765
Qt versie 5.15.2
Python versie 3.9.5
GDAL/OGR versie 3.4.1
PROJ versie 8.2.1
EPSG-register databaseversie v10.041 (2021-12-03)
GEOS versie 3.10.0-CAPI-1.16.0
SQLite versie 3.35.2
PDAL versie 2.3.0
PostgreSQL client versie 13.0
SpatiaLite versie 5.0.1
QWT versie 6.1.3
QScintilla2 versie 2.11.5
OS versie Windows 10 Version 2009
       
Actieve Python plug-ins
db_manager 0.1.20
grassprovider 2.12.99
MetaSearch 0.3.5
processing 2.12.99
sagaprovider 2.12.99
QGIS-versie 3.22.3-Białowieża QGIS code revisie [1628765](https://github.com/qgis/QGIS/commit/1628765ec7) Qt versie 5.15.2 Python versie 3.9.5 GDAL/OGR versie 3.4.1 PROJ versie 8.2.1 EPSG-register databaseversie v10.041 (2021-12-03) GEOS versie 3.10.0-CAPI-1.16.0 SQLite versie 3.35.2 PDAL versie 2.3.0 PostgreSQL client versie 13.0 SpatiaLite versie 5.0.1 QWT versie 6.1.3 QScintilla2 versie 2.11.5 OS versie Windows 10 Version 2009

Actieve Python plug-ins
db_manager
0.1.20
grassprovider
2.12.99
MetaSearch
0.3.5
processing
2.12.99
sagaprovider
2.12.99

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

  • I tried with a new QGIS profile

Additional context

No response

@Jeroen-GroeneBij Jeroen-GroeneBij added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Feb 16, 2022
@Jeroen-GroeneBij
Copy link
Author

See also #47386 for a feature request to have more similar error handling between quick field calculator bar and Field calculator

@nyalldawson nyalldawson self-assigned this Oct 3, 2023
nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Oct 3, 2023
Correctly bail out when field calculation bar expression is invalid
instead of nulling fields.

Fixes qgis#47385
nyalldawson added a commit that referenced this issue Oct 9, 2023
Correctly bail out when field calculation bar expression is invalid
instead of nulling fields.

Fixes #47385
qgis-bot pushed a commit that referenced this issue Oct 9, 2023
Correctly bail out when field calculation bar expression is invalid
instead of nulling fields.

Fixes #47385
nyalldawson added a commit that referenced this issue Oct 9, 2023
Correctly bail out when field calculation bar expression is invalid
instead of nulling fields.

Fixes #47385
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Attribute Table Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants