Skip to content

Same provider address on multiple address provider #14

@antiseptikk

Description

@antiseptikk

Hi,

I found a problem in the display of addresses from the MetadataType form.
The data displayed in all blocks corresponds to the data of the last provider displayed.

I solved the problem very quickly by adding a clone on the provider :

private function addShippingAddressProviderFormViewVars(FormView $view, ShippingMethodInterface $method): void
    {
        if ($method instanceof AddressProviderAwareInterface && null !== $method->getShippingAddressProviderConfiguration()) {
            $provider = clone $this->addressProviderFactory->createFromConfiguration($method->getShippingAddressProviderConfiguration());
            $view->vars['address_provider_template'] = $provider->getShipmentMetadataTemplate();
            $view->vars['address_provider'] = $provider;
        }
    }

Here are a few screens.

Image Image

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