xpert-idea / xipblog

Prestashop 1.6 & 1.7 Xpert Blog Module
http://xpert-idea.com
GNU General Public License v3.0
35 stars 27 forks source link

Post Feature Image is not saved at post creation #3

Open anthonyivol opened 7 years ago

anthonyivol commented 7 years ago

Hi, Post Feature Image is not saved at post creation. I have to reopen the post, upload the image, and save it again for this to work. Any idea on why and how to fix it ?

kamruljpi commented 7 years ago

please check root/modules/xipblog/img/ folder write permission. May be there it has not any write permission. please change permission then try again .

anthonyivol commented 7 years ago

Thanks for your reply. I tried with 777 on a fresh module install and this didn't fix the issue. I am working with a PS 1.7 by the way.

johanmater commented 7 years ago

Same problem here Prestashop 1.7 rezise did not work either, permission 777 not working reinstall database table gone

anthonyivol commented 6 years ago

So the image name is actually saved but the image is not uploaded and processed. In classes/xippostsclass.php, line 108, isset($this->post_img) && !empty($this->post_img) is equal to true on post creation.

This change fix the issue

if(isset($this->post_img) && !empty($this->post_img)){ $this->post_img = $this->post_img; }else{ $this->post_img = xipblog::UploadMedia('post_img'); }

change to :

if(isset($this->post_img) && !empty($this->post_img)){ $this->post_img = xipblog::UploadMedia('post_img'); }

kamruljpi commented 6 years ago

thanks