Skip to content

fix: bug fix for adding nested entity relations#119

Open
marmionl wants to merge 1 commit intodweber019:mainfrom
marmionl:nested-relations-fix
Open

fix: bug fix for adding nested entity relations#119
marmionl wants to merge 1 commit intodweber019:mainfrom
marmionl:nested-relations-fix

Conversation

@marmionl
Copy link
Copy Markdown

@marmionl marmionl commented Mar 31, 2026

hasOwnProperty was previously used in the processor to find the attribute used for a relation, defined in the app-config.yaml file. This function does not have any understanding for dot notation paths so it was failing to add relations that made use of this (i.e. nested relations). The check would therefore return false and exit early before any relation processing occured, including a previous feature implementation for nested relations, a0ff803 .

This change simply switches out this function for the get function from lodash (also used in the previous implementaiton attempt). Screenshots from before and after provided below, note that the productOwner relation did not generate before this fix, but now does.

Before:
Screenshot 2026-03-31 at 18 31 19
Screenshot 2026-03-31 at 18 31 08
Screenshot 2026-03-31 at 18 30 53
Screenshot 2026-03-31 at 18 30 45

After:
Screenshot 2026-03-31 at 18 29 18
Screenshot 2026-03-31 at 18 29 08
Screenshot 2026-03-31 at 18 28 59
Screenshot 2026-03-31 at 18 28 52

N.B. the relationship graph does not show any custom relationships, but the relationship table does. I have fixed this locally my end but the solution was a bit of a hack so I don't think it's worth contributing to the plugin for now. The nested relationships are being generated however as you can see in the inspected entities

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.

1 participant