File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -131,8 +131,7 @@ public function getMediaPath($media)
131131
132132 try {
133133 return MediaLibrary::instance ()->getMediaRelativePath (trim ($ media , '/ ' ));
134- }
135- catch (SystemException $ ex ) {
134+ } catch (SystemException $ ex ) {
136135 return $ media ;
137136 }
138137 }
@@ -238,13 +237,13 @@ public function onAddAttachment()
238237 ));
239238 }
240239
241- $ items = $ this ->validate (request ()->input (), [
240+ $ data = $ this ->validate (request ()->input (), [
242241 'items ' => ['required ' , 'array ' ],
243242 'items.*.name ' => ['required ' , 'string ' ],
244243 'items.*.path ' => ['required ' , 'string ' ],
245244 ]);
246245
247- if (!is_array ($ items ))
246+ if (!is_array ($ items = array_get ( $ data , ' items ' ) ))
248247 throw new ApplicationException (lang ('main::lang.media_manager.alert_select_item_to_attach ' ));
249248
250249 $ model = $ this ->model ;
You can’t perform that action at this time.
0 commit comments