From edb046d48ee383a07e6806b3ac80bcb7b13f1631 Mon Sep 17 00:00:00 2001 From: drwho495 <70452450+drwho495@users.noreply.github.com> Date: Sun, 7 Sep 2025 20:40:47 -0500 Subject: [PATCH] Toponaming: Remove updateElementReferences call in getLinks methods. (#23525) * remove calls to updateElementReferences in getLinks * add description of the bug for future developers' sake --- src/App/PropertyLinks.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/App/PropertyLinks.cpp b/src/App/PropertyLinks.cpp index 341484375a..a493fafc26 100644 --- a/src/App/PropertyLinks.cpp +++ b/src/App/PropertyLinks.cpp @@ -2082,7 +2082,10 @@ void PropertyLinkSub::getLinks(std::vector& objs, { if (all || _pcScope != LinkScope::Hidden) { if (_pcLinkSub && _pcLinkSub->isAttachedToDocument()) { - updateElementReferences(_pcLinkSub); + // we use to run this method everytime the program needed to access the sub-elements in + // a property link, but it caused multiple issues (#23441 and #23402) so it has been + // commented out. + // updateElementReferences(_pcLinkSub); objs.push_back(_pcLinkSub); if (subs) { *subs = getSubValues(newStyle); @@ -3154,7 +3157,10 @@ void PropertyLinkSubList::getLinks(std::vector& objs, objs.reserve(objs.size() + _lValueList.size()); for (auto obj : _lValueList) { if (obj && obj->isAttachedToDocument()) { - updateElementReferences(obj); + // we use to run this method everytime the program needed to access the sub-elements in + // a property link, but it caused multiple issues (#23441 and #23402) so it has been + // commented out. + // updateElementReferences(obj); objs.push_back(obj); } } @@ -4105,8 +4111,6 @@ void PropertyXLink::onContainerRestored() for (size_t i = 0; i < _SubList.size(); ++i) { _registerElementReference(_pcLink, _SubList[i], _ShadowSubList[i]); } - - // updateElementReferences(_pcLink); } void PropertyXLink::updateElementReference(DocumentObject* feature, bool reverse, bool notify) @@ -4659,7 +4663,10 @@ void PropertyXLink::getLinks(std::vector& objs, bool newStyle) const { if ((all || _pcScope != LinkScope::Hidden) && _pcLink && _pcLink->isAttachedToDocument()) { - updateElementReferences(_pcLink, false); + // we use to run this method everytime the program needed to access the sub-elements in + // a property link, but it caused multiple issues (#23441 and #23402) so it has been + // commented out. + // updateElementReferences(_pcLink, false); objs.push_back(_pcLink); if (subs && _SubList.size() == _ShadowSubList.size()) { *subs = getSubValues(newStyle); @@ -5394,7 +5401,10 @@ void PropertyXLinkSubList::getLinks(std::vector& objs, for (auto& l : _Links) { auto obj = l.getValue(); if (obj && obj->isAttachedToDocument()) { - updateElementReferences(obj); + // we use to run this method everytime the program needed to access the sub-elements in + // a property link, but it caused multiple issues (#23441 and #23402) so it has been + // commented out. + // updateElementReferences(obj); auto subnames = l.getSubValues(newStyle); if (subnames.empty()) {