Skip to content

Moving relationships in the model browser trigger #3359

@ghillebrand

Description

@ghillebrand

Describe the bug

Moving relationships in the model browser, into or out of the model, generates and error.

To Reproduce

Steps to reproduce the behavior:

  1. Created a new, generic model
  2. Add 2 classes and an association
  3. In the model browser, attempt to move the relationships out of the model, onto/ into "New Diagram"
  4. Nothing happens in the browser, but the error message pops up.

Image of scenario above:
image

Initially, created in this test/ scratch model, created the same way as above.
Now the relationships are root objects in the model, and cannot be moved into a model.

image
New Model error 2024_06_22.zip

Error Log:

Gaphor version:         2.25.1
Operating System:       Windows (10)
Display:                GdkWin32Display
Python version:         3.12.3
GTK version:            4.14.2
Adwaita version:        1.5.0
GtkSourceView version:  5.12.0
Cairo version:          1.18.0
Pango version:          1.52.2
PyGObject version:      3.48.1
Pycairo version:        1.26.0


Errors:

Time since application startup: 1:40:27
|Traceback (most recent call last):
|  File "C:\Program Files\Gaphor\_internal\gaphor\ui\modelbrowser.pyc", line 583, in list_item_drop_drop
|AttributeError: 'NoneType' object has no attribute 'owner'
└─────────────────────────────╌┄┈
Time since application startup: 2:07:16
|Traceback (most recent call last):
|  File "C:\Program Files\Gaphor\_internal\gaphor\ui\modelbrowser.pyc", line 590, in list_item_drop_drop
|  File "C:\Program Files\Gaphor\_internal\gaphor\diagram\group.pyc", line 20, in change_owner
|AttributeError: 'NoneType' object has no attribute 'model'
└─────────────────────────────╌┄┈
Time since application startup: 2:21:00
|Traceback (most recent call last):
|  File "C:\Program Files\Gaphor\_internal\gaphor\ui\modelbrowser.pyc", line 590, in list_item_drop_drop
|  File "C:\Program Files\Gaphor\_internal\gaphor\diagram\group.pyc", line 20, in change_owner
|AttributeError: 'NoneType' object has no attribute 'model'
└─────────────────────────────╌┄┈
Time since application startup: 2:25:36
|Traceback (most recent call last):
|  File "C:\Program Files\Gaphor\_internal\gaphor\ui\modelbrowser.pyc", line 590, in list_item_drop_drop
|  File "C:\Program Files\Gaphor\_internal\gaphor\diagram\group.pyc", line 20, in change_owner
|AttributeError: 'NoneType' object has no attribute 'model'
└─────────────────────────────╌┄┈
Time since application startup: 2:25:39
|Traceback (most recent call last):
|  File "C:\Program Files\Gaphor\_internal\gaphor\ui\modelbrowser.pyc", line 590, in list_item_drop_drop
|  File "C:\Program Files\Gaphor\_internal\gaphor\diagram\group.pyc", line 20, in change_owner
|AttributeError: 'NoneType' object has no attribute 'model'
└─────────────────────────────╌┄┈
Time since application startup: 2:28:47
|Traceback (most recent call last):
|  File "C:\Program Files\Gaphor\_internal\gaphor\ui\modelbrowser.pyc", line 590, in list_item_drop_drop
|  File "C:\Program Files\Gaphor\_internal\gaphor\diagram\group.pyc", line 26, in change_owner
|AttributeError: 'NoneType' object has no attribute 'owner'
└─────────────────────────────╌┄┈

Expected behaviour

The relationships are moved to beneath the element on which they are dropped.
If they can't be dropped, ideally, a "no entry" cursor" displays. Alternatively, nothing happens (as per current action), but also no error popup.

OS

  • Linux (Please put in notes the specific distro)
  • macOS
  • Windows (10)

Version

Version of Gaphor: 2.25.1

Additional information

Not a high priority issue, but it does seem to sometimes hinder structuring the model correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn issue in the application

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions