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

ShopPageHydrator ignores attribute translations #2602

Open
mitelg opened this issue Sep 20, 2023 · 0 comments
Open

ShopPageHydrator ignores attribute translations #2602

mitelg opened this issue Sep 20, 2023 · 0 comments

Comments

@mitelg
Copy link
Contributor

mitelg commented Sep 20, 2023

Description:
ShopPage custom attributes are not properly hydrated by ShopPageHydrator
when requesting a shop page via the shopware_storefront.shop_page_service.
(more details below)

Possible solution:
engine/Shopware/Bundle/StoreFrontBundle/Gateway/DBAL/Hydrator/ShopPageHydrator.php:95 should pass the translationKey parameter: $this->attributeHydrator->addAttribute($shopPage, $data, 'pageAttribute', null, 'page');.

This is done in the ManufacturerHydrator.

Details:
I have added custom (translatable) attributes to s_cms_static_attributes. These attributes can be translated and saved within the backend. In a custom component I request
a page from shopware_storefront.shop_page_service via getList method.
When requesting the attribute via $page->getAttribute('core')['custom_attribute'] the attribute is always in the default language.

As far as I can tell, other hydrators are also affected.

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

No branches or pull requests

1 participant