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

Rackspace Cloudfiles are not deleted or cleaned up #194

@challgren

Description

@challgren

Rackspace Cloudfiles aren't deleted because the name of the object sent to Cloudfiles is the full URL which isn't a valid name since the format expected is {folder}/{name} or {name}. I know this project is no longer maintaned but for other people having the same issue the solution is to edit AttachmentBehavior.php around line 747 and change the following code

$transporter = $this->_getTransporter($attachment, $attachment['transport']);

return $transporter->delete($path);

to

$transporter = $this->_getTransporter($attachment, $attachment['transport']);
if ($attachment['transport']['class'] == 'cloudfiles') {
    $url = parse_url($path);
    $path = ltrim($url['path'], '/');
}
return $transporter->delete($path);

I was going to make the code folder specific but this code allows images to be deleted in moved the container to different folders. For example you first put the image in the folder Items and then decide to change the folder to products. Old records that point to items will still be deleted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions