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

Fixed a Type Error when converting an Order with no Coupon to a Quote #3492

Merged

Conversation

elidrissidev
Copy link
Member

@elidrissidev elidrissidev commented Sep 4, 2023

Description (*)

A small for a Type Error that occurs when converting an Order to a Quote, the coupon_code setter should accept null since the database field is nullable.

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes Uncaught TypeError: Mage_Sales_Model_Quote::setCouponCode() #3472

Manual testing scenarios (*)

$orderId = XXXXX;
$order = Mage::getModel('sales/order')->load($orderId);
$quote = Mage::getSingleton('sales/convert_order')->toQuote($order);

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)
  • Add yourself to contributors list

Copy link
Contributor

@fballiano fballiano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have removed the method, I don't see benefit in having it, but let's get this fixed however, which is far more important

@fballiano fballiano merged commit 1d161eb into OpenMage:main Sep 4, 2023
15 checks passed
@fballiano fballiano changed the title Fix a Type Error when converting an Order with no Coupon to a Quote Fixed a Type Error when converting an Order with no Coupon to a Quote Sep 4, 2023
@elidrissidev elidrissidev deleted the fix/nullable-coupon-code-setter branch September 4, 2023 15:37
@sreichel
Copy link
Contributor

sreichel commented Sep 4, 2023

I would have removed the method, I don't see benefit in having it, but let's get this fixed however, which is far more important

Real methods are much more faster. (see #3245) From my POV - like in M2- every DB field should have its getter/setter methods. Already started it, but thats a lot of work. Type casting like (string) $xyz could or should be avoided. imho

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

Successfully merging this pull request may close these issues.

Uncaught TypeError: Mage_Sales_Model_Quote::setCouponCode()
4 participants