sulu / SuluArticleBundle

Bundle for managing localized content-rich entities like blog-posts in the Sulu content management system
MIT License
52 stars 77 forks source link

hreflang tag generation broken for unpublished articles #587

Closed popoplanter closed 2 years ago

popoplanter commented 2 years ago
Q A
Bug? yes
New Feature? no
SuluArticleBundle Version 2.3.1
Sulu Version 2.3.0

Actual Behavior

In article pages an unpublished page for a localization causes the other localizations to generate hreflang tags linking to that unpuplished page. Only if the article for the localization is deleted, the hreflang tag also gets deleted. If an article is created for the first time and no other localization version for the article exists, the hreflang tags are correct.

Expected Behavior

Just like in normal pages, articles should not be generating hreflang tags for unpublished articles.

Steps to Reproduce

create an article and a version of the same article in another language. then unpublish one of them and check the hreflang tags on the other one. it should be removed and not linking to a 404 page of the unpublished articles.

Possible Solutions

Fix the "alternate" in "localizations" property from true to false when unpublishing an article.

currently its like this: Bildschirmfoto 2021-07-22 um 16 45 39

should be like this: Bildschirmfoto 2021-07-22 um 16 45 10

niklasnatter commented 2 years ago

@C-burr Thanks for reporting! Could you check if #589 fixes the issue in your project?

luca-rath commented 2 years ago

@C-burr Should be fixed now and will be released as 2.3.2