Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
When saving an entity containing a HasOne relationship, Voyager tries to write the related id into the wrong table. #1866
The entity cannot be saved since voyager is complaining about a missing field. That field is supposed to be looked up in the db table of the related, not the source object.
An Event has one Agenda. The agenda has a db column named event_id.
The Model classes are as follows:
DB table for agendas:
The BREAD config of Event looks like this:
Steps To Reproduce:
Extract and run the attached project. The DB dump is inside the app's root folder. It is populated with three Agenda Entities. Go to Events in the Menu on the left and try to create a new one.
Expected result: The Form renders a dropdown, allowing the user to select an Agenda.
Actual result: "Agenda 1" - the name of the first Agenda Entity is rendered as plain text instead of a dropdown. When trying to save the Event an Exception is thrown.
Skips hasMany relationship fields. Not sure if there's a use-case where some update actually needs to happen on the related rows.