[FIXED] Ticket #4453 - Problem to removing references in a PropertyLinkListGlobal

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
walpa
Posts: 35
Joined: Wed Nov 09, 2016 5:22 pm
Location: Brazil

[FIXED] Ticket #4453 - Problem to removing references in a PropertyLinkListGlobal

Postby walpa » Wed Oct 07, 2020 9:53 pm

HI,

I don't know if it's a bug or I'm doing something wrong.

When trying to clear the property links, the exception is generated:
<Exception> type must be 'DocumentObject' or list of 'DocumentObject', not NoneType
And the link persists.

The attached script shows the situation:
- copy the script to the ./FreeCAD/Macro folder
- open the FC
- run the script
- create the link in the "Operates On" property
- try removing this link

phpBB [video]



OS: Linux Mint 19.3 (X-Cinnamon/cinnamon)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22611 (Git) AppImage
Build type: Release
Branch: master
Hash: 7eeec7a5990cc786723225ca8de16ca3186545b3
Python version: 3.8.5
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.4.0
Locale: Portuguese/Brazil (pt_BR)

Please, guide me!
Thank you for your help!
Attachments
test_PropertyLinkListGlobal.py
(2.61 KiB) Downloaded 11 times
Last edited by Kunda1 on Sat Nov 21, 2020 4:27 pm, edited 2 times in total.
Reason: Added [Fixed] to thread title
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: Problem to removing references in a PropertyLinkListGlobal

Postby vocx » Wed Oct 07, 2020 10:15 pm

walpa wrote:
Wed Oct 07, 2020 9:53 pm
When trying to clear the property links, the exception is generated:
<Exception> type must be 'DocumentObject' or list of 'DocumentObject', not NoneType
This looks like a bug.

It works fine from the Python console, so the error is only triggered when trying to clear the property by the property editor and Link dialog.

Code: Select all

App.ActiveDocument.test.SomeProperty = []
wmayer wrote: ping
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
walpa
Posts: 35
Joined: Wed Nov 09, 2016 5:22 pm
Location: Brazil

Re: Problem to removing references in a PropertyLinkListGlobal

Postby walpa » Thu Oct 08, 2020 12:26 pm

Thanks @vocx and @wmayer for the quick response.

Created ticket 0004453 in bug tracker.

I look forward to the solution. :)
User avatar
Kunda1
Posts: 8772
Joined: Thu Jan 05, 2017 9:03 pm

Re: Ticket #4453 - Problem to removing references in a PropertyLinkListGlobal

Postby Kunda1 » Thu Oct 08, 2020 1:31 pm

Linking to ticket: issue #4453 + added ticket number to thread title
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
chennes
Posts: 49
Joined: Fri Dec 23, 2016 3:38 pm
Contact:

Re: Ticket #4453 - Problem to removing references in a PropertyLinkListGlobal

Postby chennes » Tue Nov 10, 2020 3:29 am

Kunda1 wrote:
Thu Oct 08, 2020 1:31 pm
Linking to ticket: issue #4453 + added ticket number to thread title
I think I got this fixed with https://github.com/FreeCAD/FreeCAD/pull/4036. Just a one-liner, converting an empty link list from "None" to "[]".

ETA: For posterity's sake, that turned out to not be the fix after all, but @yorikvanhavre and @wwmayer got me straightened out :).
Last edited by chennes on Sat Nov 21, 2020 5:51 pm, edited 1 time in total.
Chris Hennes
Pioneer Library System
User avatar
Kunda1
Posts: 8772
Joined: Thu Jan 05, 2017 9:03 pm

Re: [FIXED] Ticket #4453 - Problem to removing references in a PropertyLinkListGlobal

Postby Kunda1 » Sat Nov 21, 2020 4:28 pm

git commit 031619db
Marked thread as [FIXED]
Thank you @chennes
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features