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

Fix : Load Region Model Correctly #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

meminuygur
Copy link

If region Id exist the model should be loaded by ->load() method instead of loadByCode().


name: Load Region Model Correctly

Description

Load Region Model Correctly

How To Reproduce

Steps to reproduce the behavior:
I discovered this issue after installing this module. After this module installed new order mails are could not been sent.
And got this exception log
[2024-08-29T12:14:58.711410+00:00] .CRITICAL: Error: Object of class Magento\Directory\Model\Region could not be converted to string in /home/magento/vendor/magento/module-directory/Model/ResourceModel/Region.php:143 Stack trace: #0 /home/magento/vendor/magento/module-directory/Model/Region.php(59): Magento\Directory\Model\ResourceModel\Region->loadByCode() #1 /home/magento/vendor/affirm/magento2/Model/Observer/AddressFormat.php(48): Magento\Directory\Model\Region->loadByCode()

Then I discovered this bug in code.

Expected behavior

If the region name was missing should be filled correctly via this observer

Screenshots

Benefits

Fixes the issue

Additional information

If region Id exist the model should be loaded by ->load() method instead of loadByCode().
@eneskirca
Copy link

is there any update ? @kkong87

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

Successfully merging this pull request may close these issues.

2 participants