Bug report #14162

Cannot set parent to NULL in relation reference widget

Added by Tudor Bărăscu almost 9 years ago. Updated over 8 years ago.

Status:Closed
Priority:Normal
Assignee:Sebastian Dietrich
Category:Relations
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:22164

Description

Although the ``Allow null value`` option is checked if a child already has a parent, I cannot set that parent to NULL from the form.

Tested under Debian Stretch, QGIS 2.12.3 and Master.

I have attached data so that the issue is easily reproduced.

relations_bug.zip (196 KB) Tudor Bărăscu, 2016-01-24 06:44 AM

relations_bug.gif (813 KB) Tudor Bărăscu, 2016-02-06 12:04 AM


Related issues

Related to QGIS Application - Bug report #13970: Relation reference widget does not retain values Closed 2015-12-10

Associated revisions

Revision 5f157a90
Added by Sebastian Dietrich over 8 years ago

offer NULL value in relation reference widget if allowed (fixes #14162)

Revision e08130d7
Added by Matthias Kuhn over 8 years ago

Merge pull request #2827 from SebDieBln/AllowNullInRelationRef

[Bugfix] offer NULL value in relation reference widget if allowed (fixes #14162)

History

#1 Updated by Denis Rouzaud almost 9 years ago

  • Status changed from Open to Feedback

the null button is only displayed when read-only selector is used.
otherwise, first entry in the list should be the NULL value

#2 Updated by Giovanni Manghi almost 9 years ago

  • Category changed from GUI to Relations

#3 Updated by Tudor Bărăscu almost 9 years ago

Hi and thanks for the info.
I understand that when the user has checked the Use a read-only line edit instead of a combobox box, he has the opportunity to set the parent to NULL by clicking on the X.

However, I am considering that as a workaround because if the Default setting (combobox) is used, and the Allow null value option is checked then there is no way to select the NULL value from the combobox, and the user is restricted to the selection between other parents.

I'm attaching a GIF so that it's clearer.

#4 Updated by Sebastian Dietrich almost 9 years ago

  • OS version deleted (Stretch)
  • Operating System deleted (Debian)
  • Status changed from Feedback to Open

Confirmed in current master (4c63c85cca6b33150c2af67895a2083dc69a7c5d), but the behaviour changed a little:
Now the combobox does not contain a NULL entry at all, while before it contained one that was not selectable.

#5 Updated by Sebastian Dietrich over 8 years ago

  • % Done changed from 0 to 100
  • Pull Request or Patch supplied changed from No to Yes
  • Assignee set to Sebastian Dietrich
  • Status changed from Open to In Progress

See PR 2827 for a solution.

#6 Updated by Anonymous over 8 years ago

  • Status changed from In Progress to Closed

Also available in: Atom PDF