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

Value Relation can not be set to "(no selection)" when in completer mode #39676

Open
RobinRots opened this issue Oct 28, 2020 · 3 comments
Open
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Forms Relations

Comments

@RobinRots
Copy link

RobinRots commented Oct 28, 2020

Describe the bug

When the value relation widget is set up in completer mode there is no simple way of setting a value back to "(no selection)". You can work around it by using the expression-box of the attribute table, thus setting values to NULL, but it should be as intuitive as when not in completer mode (then you can just select "(no selection)" in the drop-down). The problem is probably that deleting the value sets it back to a no-text-value '' but not to NULL. Probably "(no selection)" is only triggered when the value is set to NULL and not when it's ''.

How to Reproduce

see bugreport_completer_noselection.zip

  1. Open the poject
  2. Open the attribute table "value_relation_example" and put it in form-mode if it wouldn't be
  3. Select a feature in the left panel and delete its value in the column "with_completer"
  4. Select another feature in the left panel, then the ajusted feature again.
  5. You now see that the value you just deleted is back again.

To make this more clear I have put it in a gif:
bugreport_noselection_completer

QGIS and OS versions

QGIS version 3.16.0-Hannover QGIS code revision 43b64b1
Compiled against Qt 5.11.2 Running against Qt 5.11.2
Compiled against GDAL/OGR 3.1.4 Running against GDAL/OGR 3.1.4
Compiled against GEOS 3.8.1-CAPI-1.13.3 Running against GEOS 3.8.1-CAPI-1.13.3
Compiled against SQLite 3.29.0 Running against SQLite 3.29.0
PostgreSQL Client Version 11.5 SpatiaLite Version 4.3.0
QWT Version 6.1.3 QScintilla2 Version 2.10.8
Compiled against PROJ 6.3.2 Running against PROJ Rel. 6.3.2, May 1st, 2020
OS Version Windows 10 (10.0)
Active python plugins autoSaver; geopunt4Qgis; OSMDownloader; qfieldsync; qgis-maptiler-plugin; quick_map_services; SelectWithin; splitmultipart; SpreadsheetLayers; db_manager; MetaSearch; processing

Additional context

I was testing whether the bugfix for bug #38801 solved my issue and found out it only partly does so. When the value relation widget is set up without completer functionality, it works fine. Thanks for that!
Also, see feature request #39677.

@RobinRots RobinRots added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Oct 28, 2020
@gioman
Copy link
Contributor

gioman commented Oct 28, 2020

B/ the feature request

@RobinRots must be filed in a separate ticket.

@RobinRots
Copy link
Author

B/ the feature request

@RobinRots must be filed in a separate ticket.

Done! Feature request deleted from this bug report and transferred to #39677

@Pedro-Murteira
Copy link

Still valid on QGIS 3.22.3. (Windows 10)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Forms Relations
Projects
None yet
Development

No branches or pull requests

3 participants