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

Meta information in landing pages is not inherited #3712

Closed
michnhokn opened this issue May 14, 2024 · 3 comments
Closed

Meta information in landing pages is not inherited #3712

michnhokn opened this issue May 14, 2024 · 3 comments
Labels

Comments

@michnhokn
Copy link

PHP Version

8.2

Shopware Version

trunk

Expected behaviour

The meta information of the landing page should use the translated version of the field.

Actual behaviour

If the language has no defined name or meta title, it will not fall back to the default languages, the meta title will be empty:

$metaInformation = new MetaInformation();
$metaTitle = $landingPage->getMetaTitle() ?? $landingPage->getName();
$metaInformation->setMetaTitle($metaTitle ?? '');
$metaInformation->setMetaDescription($landingPage->getMetaDescription() ?? '');
$metaInformation->setMetaKeywords($landingPage->getKeywords() ?? '');
$page->setMetaInformation($metaInformation);

How to reproduce

Simply create two languages and add a landing page. The meta title in the default language will work.
If you do not translate the title in the other language, it will NOT fall back based on the language id chain and will therefore be empty.

@michnhokn michnhokn added the Bug label May 14, 2024
@mitelg
Copy link
Member

mitelg commented May 14, 2024

https://issues.shopware.com/issues/NEXT-31206 seems to be the same issue. could we close the issue here then?

@michnhokn
Copy link
Author

@mitelg Yeah sure. Tbh I was not looking there ;)

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

No branches or pull requests

2 participants