Skip to content

Commit

Permalink
Fixing setting default to empty array of getting the files of the form
Browse files Browse the repository at this point in the history
  • Loading branch information
nWidart committed Jun 13, 2016
1 parent 1dec1e6 commit 1e5946b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Events/Handlers/HandleMediaStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private function handleMultiMedia(StoringMedia $event)

foreach ($postMedias as $zone => $attributes) {
$orders = $this->getOrdersFrom($attributes);
foreach ($attributes['files'] as $fileId) {
foreach (array_get($attributes, 'files', []) as $fileId) {
$order = array_search($fileId, $orders);
$entity->files()->attach($fileId, ['imageable_type' => get_class($entity), 'zone' => $zone, 'order' => $order]);
}
Expand Down

0 comments on commit 1e5946b

Please sign in to comment.