Closed wpluut closed 3 months ago
Hi @wpluut
In v3.6, the relation controller will initialize all the necessary widgets, even if they are not used. In v3.5, it would try to guess whether they were used or not. This change was necessary to allow nested relations to function correctly.
The error can occur when an event previously provided a Form widget now gets a List widget. This can happen in the relationExtendManageWidget
or relationExtendViewWidget
method overrides in your controller.
There are two options:
$widget
is an instance of the expected \Backend\Widgets\Form
class (backwards compatible).Old Method | New Method |
---|---|
relationExtendViewWidget |
relationExtendViewFormWidget |
relationExtendManageWidget |
relationExtendManageFormWidget |
I hope this helps.
Hi @daftspunk,
Thanks!
Overriding relationExtendManageWidget
to relationExtendManageFormWidget
solved the issue.
I have a model with a morphMany realtionship, called 'dates':
In my fields.yaml file I render these 'dates' with a partial, like:
The partial only renders the relation (so nothing fancy):
<?= $this->relationRender('dates') ?>
This worked in OctoberCMS 3.5.x but the latest OctoberCMS version 3.6.11 gives the following error:
Call to undefined method Backend\Widgets\Lists::setFormValues
For now I have downgraded to the 3.5.x version. Do you have any ideas on what is wrong?