"Cannot delete photo! Please try again later" on cover photos

Huck Jones Posted in Technical Support 10 years ago

I'm getting this upon trying to test the photos functionality on my OSSN site. I can add/set cover photos, but for some reason whenever I try to delete them, only the file itself is deleted but not the entry, and I end up with the aforementioned error message. My data folder permissions are set to 777, and I did install OSSN to a T as stated in the tutorial. Also, it appears to work properly on regular photos and on those uploaded on the timeline.

Another thing is that there's no feature to delete or edit albums as well, which is, suffice it to say, quite an inconvenience.

Replies
Chathuranga Bw Replied 10 years ago

i think this is the correct way

if($this->deleteEntity($this->fileid)){
//delete file
unlink($source);
$params['photo'] = get
objectvars($file);
ossn
trigger_callback('delete', 'profile:cover:photo', $params);

> return true;

    }
Chathuranga Bw Replied 10 years ago

Actually It's not working properly

becouse photo was deleted but massage appear

"Cannot delete photo! Please try again later"

you should change the return value

sorry about my English :P

* Delete profile cover photo
 *
 * @return bool;
 */
public function deleteProfileCoverPhoto() {
     if (isset($this->photoid)) {

        $this->file_id = $this->photoid;
        $this->entity = new OssnEntities;
        $file = $this->fetchFile();
        $source = ossn_get_userdata("user/{$file->owner_guid}/{$file->value}");

        if($this->deleteEntity($this->file_id)){
            //delete file
            unlink($source);
            $params['photo'] = get_object_vars($file);
            ossn_trigger_callback('delete', 'profile:cover:photo', $params);
        }

    }
    **return true;** -- change here 
}
ph Huck Jones Replied 10 years ago

You're welcome! :D

Oh and what about the album editing/deletion functionality?

Indonesian Arsalan Shah Replied 10 years ago

Thanks for report, we have fixed it now:

https://github.com/opensource-socialnetwork/opensource-socialnetwork/issues/427

You can download a components/OssnPhotos/classes/OssnPhotos.php file, and replace it to your existing Ossn 2.3 file.