This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hello, I'm building a plugin settings page, where I'd like to choose my homepage featured content. I follow the docs ( https://octobercms.com/docs/plugin/settings ) and everything is working pretty well. I can add a repeater field
test_field:
type: repeater
form:
fields:
added_at:
label: Date added
type: datepicker
details:
label: Details
type: textarea
and save my values, and I can also add a recordfinder field
product:
label: Test Finder
span: auto
type: recordfinder
list: $/mmes/products/models/product/columns.yaml
nameFrom: nome
and save my values. But when I put my recordfinder inside my repeater, the form behaviour is correct but my recordfinder values are not saved nor updated (while all other fields are correctly saved). I tried other widgets inside repeater and I always can save values, the only exception is recordfinder. One important thing is that, in order to get my recordfinder to work (as stand alone field), I needed to create a relation inside Settings class in order to avoid this error (https://octobercms.com/forum/post/when-i-click-a-record-finder-field-why-is-it-causing-errors-answered-inside):
public $belongsTo = [
'product' => ['Mmes\Products\Models\Product']
];
Maybe this relation only supports one recordfinder?
Last updated
If anyone still has a problem with this add these two lines to the repeater element in the fields.yaml:
modelClass: \Your\Plugin\Model\Foo
useRelation: false
Note that saving the fields using Builder will remove these lines
martynas.janu28808 said:
If anyone still has a problem with this add these two lines to the repeater element in the fields.yaml:
modelClass: \Your\Plugin\Model\Foo useRelation: false
Note that saving the fields using Builder will remove these lines
it's worked :)
thanks bro
Last updated
1-4 of 4