File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
src/Panel/Controller/Dialog Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 130130 return $ ids ;
131131 },
132132 'toId ' => function (ModelWithContent $ model ) {
133- return $ model ->id ();
133+ return $ model ->uuid ()?->toString() ?? $ model -> id ();
134134 },
135135 'toItem ' => function (ModelWithContent $ model ) {
136- return $ model ->panel ()->pickerData ([
136+ $ item = $ model ->panel ()->pickerData ([
137137 'image ' => $ this ->image ,
138138 'info ' => $ this ->info ?? false ,
139139 'layout ' => $ this ->layout ,
140140 'model ' => $ this ->model (),
141141 'text ' => $ this ->text ,
142142 ]);
143+
144+ return [
145+ ...$ item ,
146+ 'id ' => $ item ['uuid ' ] ?? $ item ['id ' ]
147+ ];
143148 },
144149 'toItems ' => function (array $ models = []) {
145150 return A::map (
Original file line number Diff line number Diff line change @@ -60,13 +60,18 @@ abstract public function find(string $id): ModelWithContent|null;
6060 */
6161 public function item (ModelWithContent $ model ): array
6262 {
63- return $ model ->panel ()->pickerData ([
63+ $ item = $ model ->panel ()->pickerData ([
6464 'model ' => $ this ->model ,
6565 'image ' => $ this ->image ,
6666 'info ' => $ this ->info ,
6767 'layout ' => $ this ->layout ,
6868 'text ' => $ this ->text ,
6969 ]);
70+
71+ return [
72+ ...$ item ,
73+ 'id ' => $ item ['uuid ' ] ?? $ item ['id ' ]
74+ ];
7075 }
7176
7277 /**
You can’t perform that action at this time.
0 commit comments