Skip to content

Commit

Permalink
File upload is broken for nested fields [#34]
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Oct 16, 2019
1 parent 18cd6eb commit 83b7a91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* Flex Pages: Fixed frontend issues with plugin events [#5](https://github.com/trilbymedia/grav-plugin-flex-objects/issues/5)
* Flex Pages: Fixed `filePathClean()` and `filePathClean()` not returning file for folder
* Flex Pages: Fixed multiple multi-language related issues in admin [#10](https://github.com/trilbymedia/grav-plugin-flex-objects/issues/10)
* File upload is broken for nested fields [#34](https://github.com/trilbymedia/grav-plugin-flex-objects/issues/34)

# v1.0.0-beta.10
## 10/03/2019
Expand Down
4 changes: 2 additions & 2 deletions classes/Controllers/MediaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ public function taskMediaUpload(): ResponseInterface
$parts = explode('.', $field);
$last = array_pop($parts);
foreach ($parts as $name) {
if (!is_array($files['name'])) {
if (!is_array($files[$name])) {
throw new \RuntimeException($this->translate('PLUGIN_ADMIN.INVALID_PARAMETERS'), 400);
}
$files = $files['name'];
$files = $files[$name];
}
$file = $files[$last] ?? null;

Expand Down

0 comments on commit 83b7a91

Please sign in to comment.