Bug report #11266

Relations "Subforms" - delete records in form view

Added by Pedro Venâncio almost 6 years ago. Updated over 4 years ago.

Status:Closed
Priority:High
Assignee:Alessandro Pasotti
Category:Forms
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 #:19565

Description

It is not possible to delete records in form view "subforms". In table view, it works as expected.

delete_record.png (31 KB) Pedro Venâncio, 2014-09-24 11:04 AM

bug_relations.zip (343 KB) Tudor Bărăscu, 2015-10-29 05:30 AM

qgis_bug_1.png (189 KB) Alessandro Pasotti, 2015-10-29 11:01 AM

Associated revisions

Revision ba4895de
Added by Alessandro Pasotti over 4 years ago

Implemented setFeatureSelectionManager in QgsListView

Partially fixes #11266

  • now passing editor context to QgsFeatureSelectionDlg
    (otherwise fails on assert parentContext.vectorLayerTools())
  • still crashes at the provider level after saving
  • unlink still doesn't work

History

#1 Updated by Pedro Venâncio almost 6 years ago

"Unlink feature" button has exactly the same behavior, ie, does not work in form view, and works correctly in table view.

#2 Updated by Jürgen Fischer over 5 years ago

  • Target version changed from Version 2.6 to Future Release - High Priority

#3 Updated by Alessandro Pasotti over 4 years ago

  • Assignee set to Alessandro Pasotti

#4 Updated by Alessandro Pasotti over 4 years ago

  • Status changed from Open to Closed
  • Resolution set to not reproducable

I cannot reproduce on >= 2.8 (also tested 2.12 and current master)

Can you please test 2.8 and latest release?

#5 Updated by Tudor Bărăscu over 4 years ago

I tested under 2.8, 2.12 and master and it's still present.
I attached data so that you can easily see the bug.

Steps to reproduce:

- opening the subscriber form, you cannot unlink a subscriber (I also attached a snapshot) unless you're using list view

#6 Updated by Alessandro Pasotti over 4 years ago

I believe that there is a misunderstanding about how this dialog is supposed to work: the delete tool will delete "selected" feature (as stated in the tooltip), when you click on a feature in the left list of the dialog you load its data in the form but it is not automatically selected.
To select a feature you have to click on the grey square icon (which turns yellow), after doing that, you can delete it.

#7 Updated by Pedro Venâncio over 4 years ago

Tudor Bărăscu wrote:

I tested under 2.8, 2.12 and master and it's still present.
I attached data so that you can easily see the bug.

Steps to reproduce:

- opening the subscriber form, you cannot unlink a subscriber (I also attached a snapshot) unless you're using list view

I also still confirm this on Windows (both with Delete and Unlink). I'll try in Linux later and report.

#8 Updated by Tudor Bărăscu over 4 years ago

Alessandro Pasotti wrote:

I believe that there is a misunderstanding about how this dialog is supposed to work: the delete tool will delete "selected" feature (as stated in the tooltip), when you click on a feature in the left list of the dialog you load its data in the form but it is not automatically selected.
To select a feature you have to click on the grey square icon (which turns yellow), after doing that, you can delete it.

Nope, no misunderstanding, although a feature is selected (the square turned yellow), you cannot unlink or delete that feature while viewing the children as forms (not as list).

#9 Updated by Pedro Venâncio over 4 years ago

Tudor Bărăscu wrote:

Nope, no misunderstanding, although a feature is selected (the square turned yellow), you cannot unlink or delete that feature while viewing the children as forms (not as list).

Same here.

#10 Updated by Alessandro Pasotti over 4 years ago

I tested the bug_relations project on 2.8 an 2.12 and I've successfully deleted "Johh" (and all other records if that matters) while in form mode.

I'm on Linux but I don't think that it can be the reason for not being able to reproduce this issue.
Can you please add a step-by-step descriptin about how to reproduce it?

#11 Updated by Alessandro Pasotti over 4 years ago

  • Status changed from Closed to Reopened

Ok, got it. I was opening the attribute table instead of using the identify tool.

#12 Updated by Alessandro Pasotti over 4 years ago

  • Resolution deleted (not reproducable)
  • Target version changed from Future Release - High Priority to Version 2.14

The bug is worse than described, because when you activate editing
from within the form (clicking the pencil icon) and click on a list
item it gets deleted even without selecting the "delete" tool.

#13 Updated by Alessandro Pasotti over 4 years ago

  • Pull Request or Patch supplied changed from No to Yes
  • % Done changed from 0 to 50

Fixed the disappearing item issue, see: https://github.com/elpaso/QGIS/commit/812113f66a1292e7004875a4e0a46b9e5bb1f3fd
Now working on the main issue.

#14 Updated by Anonymous over 4 years ago

  • Status changed from Reopened to Closed

Also available in: Atom PDF