{"action":"opened","issue":{"url":"https://api.github.com/repos/magento/magento2/issues/7504","repository_url":"https://api.github.com/repos/magento/magento2","labels_url":"https://api.github.com/repos/magento/magento2/issues/7504/labels{/name}","comments_url":"https://api.github.com/repos/magento/magento2/issues/7504/comments","events_url":"https://api.github.com/repos/magento/magento2/issues/7504/events","html_url":"https://github.com/magento/magento2/issues/7504","id":190701607,"number":7504,"title":"sitemap image URLs do not match with those on product pages","user":{"login":"maderlock","id":630320,"avatar_url":"https://avatars.githubusercontent.com/u/630320?v=3","gravatar_id":"","url":"https://api.github.com/users/maderlock","html_url":"https://github.com/maderlock","followers_url":"https://api.github.com/users/maderlock/followers","following_url":"https://api.github.com/users/maderlock/following{/other_user}","gists_url":"https://api.github.com/users/maderlock/gists{/gist_id}","starred_url":"https://api.github.com/users/maderlock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maderlock/subscriptions","organizations_url":"https://api.github.com/users/maderlock/orgs","repos_url":"https://api.github.com/users/maderlock/repos","events_url":"https://api.github.com/users/maderlock/events{/privacy}","received_events_url":"https://api.github.com/users/maderlock/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-21T12:23:36Z","updated_at":"2016-11-21T12:23:36Z","closed_at":null,"body":"This is currently stopping product images from being correctly indexed by google, which is a serious problem for our clients.\r\n\r\n### Preconditions\r\n<!--- Provide a more detailed information of environment you use -->\r\n<!--- Magento version, tag, HEAD, etc., PHP & MySQL version, etc.. -->\r\n1. Mageneto 2.1.2\r\n\r\n### Steps to reproduce\r\n<!--- Provide a set of unambiguous steps to reproduce this bug include code, if relevant  -->\r\n1. Create a product and add an image.\r\n2. Generate a sitemap\r\n\r\n### Expected result\r\n<!--- Tell us what should happen -->\r\n1. img src on product page will match image:loc in sitemap\r\n\r\n### Actual result\r\n<!--- Tell us what happens instead -->\r\n1. They do not match\r\n\r\nThe problem here is that google will not index the images from the sitemap as it the URLs do not match up.\r\n\r\nHowever, I have struggled to make these match up. gallery.phtml outputs the image as follows:\r\n````\r\n$imageUrl = $this->helper('Magento\\Catalog\\Helper\\Image')\r\n            ->init($block->getProduct(), 'product_page_image_large')\r\n            ->setImageFile($block->getImageFile())\r\n            ->getUrl();\r\n````\r\n\r\nThe sitemap gets the image url directly from the product attribute not really consecutive lines, but taken from module-sitemap/Model/Sitemap.php:\r\n````\r\nforeach ($this->_productFactory->create()->getCollection($storeId) as $item) {\r\n$images = $item->getImages();\r\nforeach ($images->getCollection() as $image) {\r\n...\r\n$row .= '<image:loc>' . htmlspecialchars($this->_getMediaUrl($image->getUrl())) . '</image:loc>';\r\n````\r\n\r\nThe problem here is that $this->_productFactory->create()->getCollection($storeId) gets an array rather than the actual products. Therefore I do not think we can use this with the image helper.\r\n\r\nAny thoughts on how to fix this issue?"}}
{"actor":{"display_login":"maderlock"}}