Skip to content

[Forwardport] magento/magento2#13498 issue #13497 - Method getUrl in Magento\Catalog\Model\Product\Attribute\Frontend\Image #13635

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

Merged
merged 1 commit into from
Feb 21, 2018

Conversation

nmalevanec
Copy link
Contributor

@nmalevanec nmalevanec commented Feb 13, 2018

Original Pull Request

#13498 (created by @igortregub)

Included Commits

  1. 220ad97

Fixed Issues (if relevant)

  1. Method getUrl in Magento\Catalog\Model\Product\Attribute\Frontend returns image url with double slash #13497: Method getUrl in Magento\Catalog\Model\Product\Attribute\Frontend returns image url with double slash

Manual testing scenarios

  1. Try to get product image via method getUrl from class Magento\Catalog\Model\Product\Attribute\Frontend\Image. Example(console command):
protected function execute(InputInterface $input, OutputInterface $output)
    {
        ObjectManager::getInstance()->get(State::class)->setAreaCode(Area::AREA_ADMINHTML);
        //Be sure, you have simple product with sku = "s1", and with image.
        $product = ObjectManager::getInstance()->get(ProductRepositoryInterface::class)->get('s1');
        $attributeRepository = ObjectManager::getInstance()->get(AttributeRepositoryInterface::class);
        $imageAttribute = $attributeRepository->get(4, 'image');
        $image = ObjectManager::getInstance()->get(\Magento\Catalog\Model\Product\Attribute\Frontend\Image::class);
        $image->setAttribute($imageAttribute);
        $output->writeln($image->getUrl($product));
    }
  1. Check, image url has only single slashes ex: "http://domain/pub/media/catalog/product/t/e/test.jpg".

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@orlangur orlangur self-assigned this Feb 13, 2018
@ihor-sviziev ihor-sviziev self-assigned this Feb 16, 2018
@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
MAGETWO-87979 has been created to process this Pull Request

Copy link
Contributor

@orlangur orlangur left a comment

Choose a reason for hiding this comment

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

@nmalevanec please rewrite branch so that original commit author is preserved (for example, with cherry pick)

…te\Frontend returns image url with double slash
@nmalevanec
Copy link
Contributor Author

@orlangur, done.

@magento-engcom-team
Copy link
Contributor

Hi @orlangur, thank you for the review.
MAGETWO-87979 has been created to process this Pull Request

@magento-engcom-team magento-engcom-team merged commit 8a2e547 into magento:2.3-develop Feb 21, 2018
magento-engcom-team pushed a commit that referenced this pull request Feb 21, 2018
…agento\Catalog\Model\Product\Attribute\Frontend\Image #13635
@nmalevanec nmalevanec deleted the forwardport-pull-13498 branch August 21, 2018 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants