Skip to content

ShopPageHydrator ignores attribute translations #2602

Open
@mitelg

Description

@mitelg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions