File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
resources/js/components/fieldtypes/replicator Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ export default {
3
3
computed : {
4
4
previewText ( ) {
5
5
const previews = _ ( this . previews ) . filter ( ( value , handle ) => {
6
- const config = _ . findWhere ( this . config . fields , { handle } ) ;
6
+ const config = _ . findWhere ( this . config . fields , { handle } ) || { } ;
7
7
return config . replicator_preview === undefined ? true : config . replicator_preview ;
8
8
} ) ;
9
9
Original file line number Diff line number Diff line change @@ -313,15 +313,15 @@ public function preload()
313
313
$ values = $ set ['attrs ' ]['values ' ];
314
314
$ config = $ this ->config ("sets. {$ values ['type ' ]}.fields " , []);
315
315
316
- return [$ set ['attrs ' ]['id ' ] => (new Fields ($ config ))->addValues ($ values )->meta ()];
316
+ return [$ set ['attrs ' ]['id ' ] => (new Fields ($ config ))->addValues ($ values )->meta ()-> put ( ' _ ' , ' _ ' ) ];
317
317
})->toArray ();
318
318
319
319
$ defaults = collect ($ this ->config ('sets ' ))->map (function ($ set ) {
320
320
return (new Fields ($ set ['fields ' ]))->all ()->map ->defaultValue ()->all ();
321
321
})->all ();
322
322
323
323
$ new = collect ($ this ->config ('sets ' ))->map (function ($ set , $ handle ) use ($ defaults ) {
324
- return (new Fields ($ set ['fields ' ]))->addValues ($ defaults [$ handle ])->meta ();
324
+ return (new Fields ($ set ['fields ' ]))->addValues ($ defaults [$ handle ])->meta ()-> put ( ' _ ' , ' _ ' ) ;
325
325
})->toArray ();
326
326
327
327
$ previews = collect ($ existing )->map (function ($ fields ) {
Original file line number Diff line number Diff line change @@ -136,10 +136,10 @@ public function preload()
136
136
'existing ' => $ existing = collect ($ this ->field ->value ())->mapWithKeys (function ($ set ) {
137
137
$ config = $ this ->config ("sets. {$ set ['type ' ]}.fields " , []);
138
138
139
- return [$ set ['_id ' ] => (new Fields ($ config ))->addValues ($ set )->meta ()];
139
+ return [$ set ['_id ' ] => (new Fields ($ config ))->addValues ($ set )->meta ()-> put ( ' _ ' , ' _ ' ) ];
140
140
})->toArray (),
141
141
'new ' => collect ($ this ->config ('sets ' ))->map (function ($ set , $ handle ) {
142
- return (new Fields ($ set ['fields ' ]))->meta ();
142
+ return (new Fields ($ set ['fields ' ]))->meta ()-> put ( ' _ ' , ' _ ' ) ;
143
143
})->toArray (),
144
144
'defaults ' => collect ($ this ->config ('sets ' ))->map (function ($ set ) {
145
145
return (new Fields ($ set ['fields ' ]))->all ()->map ->defaultValue ();
You can’t perform that action at this time.
0 commit comments