Skip to content

jmix-add-entity-event-listener: fix the isLoaded guard and cover a soft-deleted reference target - #125

Draft
glebfox wants to merge 1 commit into
v3from
feedback/119-reference-reload-recipe
Draft

glebfox wants to merge 1 commit into
v3from
feedback/119-reference-reload-recipe

Conversation

@glebfox

@glebfox glebfox commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #119.

Drafted from a field report while the problem was fresh, by the agent that hit it. It is unreviewed: treat the wording as a starting point, not a proposal to merge as-is.

Change

Two additions to "Reading a reference you nevertheless need":

  • The guard in the code block becomes isLoaded(...) && value != null, with a paragraph explaining why — EntityStates.isLoaded reports every attribute of a DataManager.getReference instance as loaded, so the plain guard takes the wrong branch and the getter returns null.
  • A paragraph on a soft-deletable target: the reload filters a soft-deleted row out and yields null indistinguishably from an unset reference, so the load needs PersistenceHints.SOFT_DELETION false.

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.

jmix-add-entity-event-listener: the reference-reload recipe misreads a getReference instance, and cannot see a soft-deleted target

1 participant