-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Cleared feature attributes not acting like they have been cleared, and preventing saving of layer #39146
Comments
Hello, you need to activate the default values evaluation on provider side in your project configuration. From Qgis menu: Project > Properties... > DataSources > Evaluate default values on provider side Instead of |
@SebastienPeillet setting that option looks more like a workaround to me. Do we all (@gioman) agree that this is still a bug? |
pretty much. |
@SebastienPeillet Are you sure? As the console log shows, th SQL is
rather than
which are two vet different things. The second is an actual NULL value that is typecast, the first is a string value that starts with the word "NULL". When QGIS doesn't have the provider side evaluate default values, it still shouldn't be sticking the text of the default value into the SQL to run as the value to be set. |
The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale". |
@SebastienPeillet Can you comment on this difference? |
I have a fix for this one. I stll have to write tests and also try to fix the grey/black difference and I'll propose a PR |
Just to be complete, #45176 fixes the main issue, meaning the error when commiting on Postgres. There is still the grey/dark issue and other tiny issues on how the attribute table manage default and null values. I will try to tackle them in separate issues/PRs |
On clearing a value from a PostGIS field with the clear button in the Feature Attributes form, QGIS later tries to save the text of the SQL default clause for that field, with the following errors on the console:
If you open up the attribute table, you can see that the field you cleared now has the SQL default clause in non-italic dark text, just like other entered variables, unlike features where the default value appears in italic and light grey.
Newly added features where the problematic field was not given a value save as expected.
How to Reproduce
stripe_rgb character varying(8) COLLATE pg_catalog."default" DEFAULT NULL::character varying
.QGIS and OS versions
Ubuntu 20.04
Additional context
As mentioned, newly added features where the problematic field was not given a value save as expected, but when Symbology is set to
Rule-based
, with the rules being based on this problematic field such as being NULL or not, as in the window shown below, the features get drawn as if the field has data, is not NULL, even though nothing was ever entered for it.The text was updated successfully, but these errors were encountered: