Skip to content

Conversation

@stonebuzz
Copy link
Contributor

Checklist before requesting a review

Please delete options that are not relevant.

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
  • This change requires a documentation update.

Description

Fix : !39723

Currently debugging the handling of orphan links in ImpactRelation.

I noticed that the check to determine whether the source or destination exists (and skip if not) relies on the following function:

public static function getItemFromArray(
    $itemtype,
    $items_id,
    array $array,
    $getFromDB = true,
    $getEmpty = true,
    $getFromDBOrEmpty = false
) {

By default, it loads an empty object if the item is not found in the database, and therefore does not return false when missing.

This seems to cause the skip logic for this relation to behave incorrectly.

Submitting the PR as-is to observe the behavior in the unit tests.

Screenshots (if appropriate):

@stonebuzz stonebuzz self-assigned this Oct 20, 2025
@stonebuzz stonebuzz added the bug label Oct 20, 2025
Copy link
Member

@cedric-anne cedric-anne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$getEmpty is ignored when $getFromDB=true. The signature is pretty ambiguous, but this changes has no impact.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants