Steps to reproduce:

  • Enable translation to media type image.
  • Enable media entities in sitemap settings
  • Enable indexing for media type image.
  • Add media content and it's translations.

In the generated sitemap, under the images column. The original content's image URLs are shown multiple times. Expected result is to get the URLs of original and the translation content's images.

Comments

shashikanth171 created an issue. See original summary.

shashikanth171’s picture

StatusFileSize
new1.18 KB

This patch applies only when all the images on the website are added via media library.

shashikanth171’s picture

StatusFileSize
new2.29 KB

With the previous patch there are unknown field 'image' errors. Attaching updated patch.

gbyte’s picture

Status: Needs review » Postponed (maintainer needs more info)

Thanks for the patch. Right now this module barely supports media image indexation, hence this issue: #2987748: Add Media images to sitemap. Would you care to explain what exactly you are doing when indexing media entities? What is the desired outcome (what type of sitemap standard are you getting out of it)? Also please take a screenshot or provide a link to the sitemap.

Regarding the patch itself, would

if ($entity->hasTranslation($langcode)) {
  //...
}

not prevent the indexation if there is no translation?

gbyte’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

Closing due to lack of activity.

s_bhandari’s picture

Status: Closed (works as designed) » Needs review
StatusFileSize
new2.35 KB

Hi,

The last patch is not getting applied on the latest version. Hence, re-rolled the patch. Please review.

Thanks.

gbyte’s picture

Status: Needs review » Closed (works as designed)

3.x is unsupported, please test 4.x and tag the issue accordingly if needed. Reverting the issue status.