Replies: 2 comments 4 replies
-
I found the problem! I have overridden the manage_form backend partial and was using a Member instance instead of a Member id. If anyone stumbles into this, the partial has only one difference, which is updating the field value before calling render():
It's working just fine. Any comments would be appreciated. |
Beta Was this translation helpful? Give feedback.
-
Only skimmed over the description but as soon as I saw the name of the field being set to If you set |
Beta Was this translation helpful? Give feedback.
-
I have Members (hasMany Payments) and Payments (belongsTo Member).
The Member Form uses a partial to render the Payments relation:
_payment_fields.htm:
The Payment Form uses a RecordFinder to choose which member is making the payment.
Of course, if it is being used from a Member form, the member is already known, so when a Member issues a Payment the payment fields.yaml uses this:
The problem is that, in the Payment form, the Member does not get initialized properly (i.e. it is always null).
I dug a bit and noticed that in Backend\FormWidgets\RecordFinder.php the getLoadValue() function uses:
which, in my case, is the source of the problem, because $value is always null.
If I change it to:
everything works just fine!
Of course, I am assuming there is something wrong with my code...
What am I missing here?
This is running in the Winter backend using:
Beta Was this translation helpful? Give feedback.
All reactions