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

[BUG] Call to a member function getAddressFormat() on null #2789

Open
gander opened this issue Jan 31, 2025 · 3 comments
Open

[BUG] Call to a member function getAddressFormat() on null #2789

gander opened this issue Jan 31, 2025 · 3 comments

Comments

@gander
Copy link
Contributor

gander commented Jan 31, 2025

Where:

CoreShop/Bundle/FrontendBundle/Resources/views/Mail/order-confirmation.html.twig
CoreShop\Component\Address\Formatter\AddressFormatter::formatAddress

What:

$convertedAddress = $this->twig->createTemplate($address->getCountry()->getAddressFormat())->render($objectVars);
\CoreShop\Component\Address\Model\AddressInterface::getCountry(): ?CountryInterface;
@dpfaffenbauer
Copy link
Member

why in the first place you don't have a country on that address?

@gander
Copy link
Contributor Author

gander commented Jan 31, 2025

The store is local only, there are no sales outside the country. Besides, the interface allows Country to be null.

@dpfaffenbauer
Copy link
Member

@gander yes it does, cause in Pimcore, everything in a DataObject is nullable...

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

2 participants