Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.

Commit

Permalink
Fix setImageData method for event form
Browse files Browse the repository at this point in the history
  • Loading branch information
ericadeefox committed Dec 12, 2017
1 parent 6c1b171 commit 1087cbe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/Controller/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public function initialize()
$this->loadModel('EventSeries');
$this->loadModel('EventsImages');
$this->loadModel('EventsTags');
$this->loadModel('Images');
$this->loadModel('MailingList');
$this->loadModel('Tags');
$this->loadModel('Users');
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/EventsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ private function setImageData($event)
$place++;
}
}
$imageData = $this->request->getData('Image');
$imageData = $this->request->getData('data.Image');
if ($imageData) {
foreach ($imageData as $imageId => $caption) {
$newImage = $this->Images->get($imageId);
Expand Down
8 changes: 5 additions & 3 deletions src/Controller/ImagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public function isAuthorized($user = null)
*/
public function upload()
{
$this->viewbuilder()->setLayout('blank');
$this->render('/Pages/blank');
$uploadDir = Configure::read('App.eventImagePath') . DS . 'full' . DS;
$fileTypes = ['jpg', 'jpeg', 'gif', 'png'];
$vars = $this->request->getData();
Expand All @@ -60,8 +62,10 @@ public function upload()
$this->response->withStatus(500);
echo 'Error saving image';
debug($newImage);
} else {
echo $newImage->id;
dd($vars);
}
echo $newImage->id;
} else {
$this->response->withStatus(500);
echo 'Error creating thumbnail';
Expand All @@ -87,8 +91,6 @@ public function upload()
$this->response->withStatus(500);
echo 'Security code incorrect';
}
$this->viewbuilder()->setLayout('blank');
$this->render('/Pages/blank');
}

/**
Expand Down

0 comments on commit 1087cbe

Please sign in to comment.