Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return the complete category image path #118

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

VincentMarmiesse
Copy link
Contributor

When a category image is imported, it's saved without the media/catalog/category path.

For instance, if I import a main.jpg image, it will be saved as /m/a/main.jpg, causing a 404 when the image is displayed.

I'm not sure if it's the cleanest way to do it tho.

@@ -1298,7 +1298,7 @@ protected function uploadMediaFiles($fileName)
{
try {
$res = $this->getUploader()->move($fileName);
return $res['file'];
return '/media/catalog/category' . $res['file'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is rather strange that this is needed as this should be handled already:

$destinationDir = "catalog/category";
$destinationPath = $dirAddon . $DS . $this->mediaDirectory->getRelativePath($destinationDir);
$this->mediaDirectory->create($destinationPath);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not on my side, could you try?
This is what I have:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants