Link/Expressions: `App::PropertyEnumeration` returns a string if addressed through an `App::PropertyLink`
#14.993 aberto em 27 de jun. de 2024
Métricas do repositório
- Stars
- (30.913 estrelas)
- Métricas de merge de PR
- (Mesclagem média 24d 7h) (217 fundiu PRs em 30d)
Description
Is there an existing issue for this?
- I have searched the existing issues
Problem description
Most uses of an App::PropertyEnumeration in Expressions will return an integer (the index selected). When access is done through any variation of App::PropertyLink, the string is returned instead (bug).
I have found this occurs in every version of FreeCAD back to 0.21.2. I did not try any earlier versions.
A fix will likely break some existing projects relying on this to access the string, but it would be trivial to update such projects. Attached is a test case, showing some variations of access.
enumeration-link-bug.FCStd.delete.this.extension.zip
Full version info
OS: Gentoo Linux (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.37841 (Git) AppImage
Build type: Release
Branch: main
Hash: 5f761c758e2a0164b00a7183b9c0cbe32688e123
Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2
Locale: English/United States (en_US)
Installed mods:
* parts_library
* Curves 0.6.40
* A2plus 0.4.65 (Disabled)
* DynamicData 2.62.0
* Assembly4 0.50.13 (Disabled)
* dodo 1.0.1
* Alternate_OpenSCAD 1.0.0 (Disabled)
* CurvedShapes 1.0.9
* Design456 0.0.1
* fasteners 0.5.24
* SearchBar 1.0.2
* Nodes 0.1.36 (Disabled)
* 3D_Printing_Tools (Disabled)
* workfeature (Disabled)
* MnesarcoUtils 0.2.5
* OpenTheme 2024.6.22
* Manipulator 1.5.7
* Assembly3 0.12.2 (Disabled)
* lattice2 1.0.0
* Launcher
* CommandPanel
* CubeMenu
* Reinforcement
* PieMenu 1.7.0
* MeshRemodel 1.9.23
Subproject(s) affected?
Expressions
Anything else?
This bug is related to https://github.com/FreeCAD/FreeCAD/issues/14578
Code of Conduct
- I agree to follow this project's Code of Conduct