View Issue Details

IDProjectCategoryView StatusLast Update
0002894FreeCADBugpublic2017-03-15 17:47
Reporteremanuele Assigned Toeivindkvedalen  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSUbuntuOS Version16.10
Product Version0.16 
Fixed in Version0.17 
Summary0002894: Using units as alias corrupts the design
DescriptionWhen changing the alias in a spreadsheet from a valid name to a reserved value, does not raise any alert but corrupt the design when you reopen it.

Tested setting the alias to t, mA and mol, but should apply to all units described in src/App/FreeCADInit.py and used by the expression parser.
Steps To ReproduceOpen FreeCAD
Press the "create new document" button
Switch to the Part workbench
Press the "Create a cube solid" button
Switch to the Spreadsheed workbench
Press the "Create a new spreadsheed" button
Double click on the new Spreadsheet in the document tree
Write 4 in cell A1
Right click on cell A1
Open the Alias tab
Set the alias for this cell as "myAlias" (without quotes)
Click OK
Doble click on the Cube in the document tree
Set the the Length as Spreadsheet.myAlis
Go back to the Spreadsheet and change the value in A1 to 6
Check in the view that the drawing has updated correctly
Save the document and close all
Reopen the document: everything should be ok
Open the Spreadsheet
Right click on cell A1
Open the Alias tab
Change the alias for this cell from "myAlias" to "mA"
Check in the view that the drawing of the cube is still correct
Go back to the Spreadsheet and change the value in A1 to 10
Check in the view that the drawing has updated correctly
Save the document and close all
Reopen the document: everything will be screwed up (the names of the solids changed, their sizes and the data in the spreadsheet lost, etc.)
Additional InformationReproduced on version:
OS: Ubuntu 16.10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6707 (Git)
Build type: None
Branch: releases/FreeCAD-0-16
Hash: 5465bc47c95db45e0be85dc0e2872419efadce0f
Python version: 2.7.12+
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
Tagsspreadsheet, units
FreeCAD Information

Activities

Kunda1

2017-02-10 11:23

administrator   ~0008262

Please open a forum thread on https://forum.freecadweb.org/viewforum.php?f=8 to discuss this issue and bidirectionally link thread <=> ticket. Thanks.

emanuele

2017-02-10 15:17

reporter   ~0008264

Opened forum thread https://forum.freecadweb.org/viewtopic.php?f=8&t=20587 to get some feedbacks from other users.
Thanks.

eivindkvedalen

2017-02-13 22:40

developer   ~0008290

Branch for testing added: https://github.com/eivindkv/FreeCAD/tree/Fix_issue_2894

Related Changesets

FreeCAD: master 338ca556

2017-03-05 23:27:19

Eivind Kvedalen


Committer: yorik Details Diff
Spreadsheet: Fixed issue 0002894: Unit strings could be used as aliases. Affected Issues
0002894
mod - src/App/Expression.cpp Diff File
mod - src/App/Expression.h Diff File
mod - src/Mod/Spreadsheet/App/PropertySheet.cpp Diff File
mod - src/Mod/Spreadsheet/TestSpreadsheet.py Diff File

Issue History

Date Modified Username Field Change
2017-02-10 11:13 emanuele New Issue
2017-02-10 11:21 Kunda1 Tag Attached: spreadsheet
2017-02-10 11:23 Kunda1 Note Added: 0008262
2017-02-10 11:23 Kunda1 Status new => feedback
2017-02-10 15:17 emanuele Note Added: 0008264
2017-02-10 15:17 emanuele Status feedback => new
2017-02-10 16:10 Kunda1 Tag Attached: units
2017-02-11 17:53 eivindkvedalen Assigned To => eivindkvedalen
2017-02-11 17:53 eivindkvedalen Status new => assigned
2017-02-13 22:40 eivindkvedalen Note Added: 0008290
2017-03-07 16:46 yorik Changeset attached => FreeCAD master 338ca556
2017-03-15 17:47 wmayer Status assigned => closed
2017-03-15 17:47 wmayer Resolution open => fixed
2017-03-15 17:47 wmayer Fixed in Version => 0.17