I am using the latest framework of CI, and while the book is written for 1.7, I have not had many major issues. I know what/where code needs to be updated for the latest framework, and so far I have had great success ... until now.
I am creating the page and functions for the Product Edit Page. The page displays as expected, however when I click the button to update the product information, I am returned a blank page.
The path I start on is : localhost/ci_fullsite_professional/admin/products/edit/17
I click submit and I get localhost/ci_fullsite_professional/admin/products/edit. I expect to the see the dashboard and the flashdata message stating the product was updated.
I can create and delete products successfully. I can create, edit and delete Categories successfully ... it's just the update of the product that returns blank.
UPDATE:
After some debugging, I found the problem code being the image upload ... however, when I look at the code I see no issues.
Code:
if(!$this->upload->do_upload('image')){
$this->upload->display_errors();
exit();
}
$image = $this->upload->data();
if ($image['file_name']){
$data['image'] = "assets/images/products/".$image['file_name'];
}
if(!$this->upload->do_upload('thumbnail')){
$this->upload->display_errors();
exit();
}
$thumb = $this->upload->data();
if ($thumb['file_name']){
$data['thumbnail'] = "assets/images/products/".$thumb['file_name'];
}
I have tried add this:
Code:
if ($_FILES['image']['name']){
if(!$this->upload->do_upload('image')){
$this->upload->display_errors();
exit();
}
$image = $this->upload->data();
... etc ...
AND I have tried add this:
Code:
if (strlen($_FILES['image']['name'])){
if(!$this->upload->do_upload('image')){
$this->upload->display_errors();
exit();
}
$image = $this->upload->data();
... etc ...
Anyone have any ideas?