Skip to content

Introduce initAfterInsert() framework function - #14402

Open
magnesj wants to merge 1 commit into
devfrom
init-after-insert-14401
Open

Introduce initAfterInsert() framework function#14402
magnesj wants to merge 1 commit into
devfrom
init-after-insert-14401

Conversation

@magnesj

@magnesj magnesj commented Jul 29, 2026

Copy link
Copy Markdown
Member

Fixes #14401

Introduce caf::PdmXmlObjectHandle::initAfterInsert() combining the manual resolveReferencesRecursively() + initAfterReadRecursively() pair that must be called after inserting a copied object into the document tree. The function resolves references first so that initAfterRead() overrides can rely on resolved pointer fields, and asserts that the object has a parent field to catch calls made before insertion (the bug class behind #14372).

Migrated the 18 call sites that used the adjacent pair (16 files). Note that RicDeleteItemExec::undo() previously called the two functions in reversed order (init before resolve); it now uses the resolve-first order like all other sites.

Intentionally not migrated:

A unit test in cafPdmAdvancedTemplateTest.cpp verifies that initAfterInsert() resolves a nulled pointer field and re-runs initAfterRead() on an inserted copy.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce initAfterInsert() to combine resolveReferencesRecursively() and initAfterReadRecursively()

1 participant