Open Jason-Dang opened 6 years ago
Good morning, I have the same problem, and solve in this way: Into my logic hook:
$myid= $bean->accounts_myModule_1accounts_ida; $account_id = null; if(is_object($myid) && $myid instanceof Link2){ $account_id = array_keys(myid->beans)[0]; } else { $account_id = $myid; }
Now, I can use $account_id like a string in a query. Hope this can help. Beatrice
Issue
When creating a record through a subpanel using the
Full Form
for a custom one to many relationship, if there is a logic hook that uses the ida of the relate field for that relationship, the bean value of the id contains the relationship link2 object rather than the related id string.Expected Behavior
Expect the ida for a relate field to always contain the id of the related record not the link object.
Actual Behavior
The value of the ida for a relate field is the link object rather than the id.
Possible Fix
Steps to Reproduce
full form
option ensuring that the relate field for the parent module you are creating from is populated.Link2
object instead of the id string.Context
Causes a 500 error anytime you create a record through a subpanel using the full form if there is a logic hook that tries to retrieve a bean using the value of an ida field.
Your Environment