Skip to content

PartDesign: fix Length/Length2 expression migration for TwoLengths pads#29247

Merged
kadet1090 merged 1 commit intoFreeCAD:mainfrom
Bojan9597:fix/partdesign-twolengths-expression-migration
Apr 13, 2026
Merged

PartDesign: fix Length/Length2 expression migration for TwoLengths pads#29247
kadet1090 merged 1 commit intoFreeCAD:mainfrom
Bojan9597:fix/partdesign-twolengths-expression-migration

Conversation

@Bojan9597
Copy link
Copy Markdown
Contributor

Fixes #29233

When opening a v1.0 TwoLengths pad, two expression cases broke during migration:

  1. Cyclic expressionLength2 = Length / 2 moved to Length as-is → Length = Length / 2 (cyclic, silently discarded)
  2. Cross-object reference — expressions in other objects referencing Pad.Length2 were never updated

Fix: call renameObjectIdentifiers({Length↔Length2}) document-wide before swapping the expression bindings. I added two regression tests covering both failure modes.

@github-actions github-actions bot added the Mod: Part Design Related to the Part Design Workbench label Apr 10, 2026
@maxwxyz maxwxyz requested a review from chennes April 10, 2026 13:27
@maxwxyz maxwxyz added Type: Bug This issue or PR is related to a bug backport releases/FreeCAD-1-1 Applied to a PR that is on main to trigger the automatic creation of another PR onto 1.1 labels Apr 10, 2026
@maxwxyz maxwxyz added this to the 1.2 milestone Apr 10, 2026
@maxwxyz maxwxyz moved this from Queue to Merge Meeting in Merge Queue Apr 10, 2026
@maxwxyz maxwxyz requested a review from PaddleStroke April 10, 2026 13:28
@adrianinsaval adrianinsaval added the Approved: Tested The PR was manually tested and approved label Apr 10, 2026
@adrianinsaval
Copy link
Copy Markdown
Member

worked for me but I only tested pretty simple files

Comment thread tests/src/Mod/PartDesign/App/BackwardCompatibility.cpp Outdated
@Bojan9597 Bojan9597 force-pushed the fix/partdesign-twolengths-expression-migration branch from 542efe3 to 79ce4e2 Compare April 10, 2026 19:30
@maxwxyz
Copy link
Copy Markdown
Collaborator

maxwxyz commented Apr 12, 2026

@Bojan9597 CI fails

@maxwxyz maxwxyz moved this from Merge Meeting to Approved in Merge Queue Apr 12, 2026
@Bojan9597 Bojan9597 force-pushed the fix/partdesign-twolengths-expression-migration branch from 79ce4e2 to 1a641f8 Compare April 12, 2026 17:58
@Bojan9597
Copy link
Copy Markdown
Contributor Author

Fixed, it was not up to me

@kadet1090 kadet1090 merged commit e07d1b0 into FreeCAD:main Apr 13, 2026
13 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in Merge Queue Apr 13, 2026
@freecad-ci-runner
Copy link
Copy Markdown
Collaborator

Successfully created backport PR for releases/FreeCAD-1-1:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved: Tested The PR was manually tested and approved backport releases/FreeCAD-1-1 Applied to a PR that is on main to trigger the automatic creation of another PR onto 1.1 Mod: Part Design Related to the Part Design Workbench Type: Bug This issue or PR is related to a bug

Projects

Status: Done

5 participants