-
-
Notifications
You must be signed in to change notification settings - Fork 437
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 erroneous call to getText() method in Mage_Usa_Model_Shipping_Carrier_Ups::getAllowedMethods() #4013
Fixed erroneous call to getText() method in Mage_Usa_Model_Shipping_Carrier_Ups::getAllowedMethods() #4013
Conversation
@ragnese do you know how to reproduce the problem? because I'm trying to but it seems that the getAllowedMethods() is never called :-\ at least in the core |
Hmm. Yeah, in our case this code was called by a custom shipping-related module/plugin that we have. So, I'm not sure if/where it is used by Core. Since it's just a type error (and not a business logic bug), it would be easy to just insert a call to it anywhere you want and watch it crash. Like, you could literally just add,
to any code path that you know is going to be called, and you will see the error. The bug and fix are also very obvious. The for-loop in that method was copy+pasted from the Magento2 code base, but the It's clear that the |
@ragnese can you please make the PR editable? I think the whole method should be this: public function getAllowedMethods()
{
$allowedMethods = explode(',', (string)$this->getConfigData('allowed_methods'));
$availableByTypeMethods = $this->getCode('originShipment', $this->getConfigData('origin_shipment'));
$methods = [];
foreach ($availableByTypeMethods as $methodCode => $methodData) {
if (in_array($methodCode, $allowedMethods)) {
$methods[$methodCode] = $methodData;
}
}
return $methods;
} because checkin for isXML or isRest is totally useless |
a4f0ff1
to
254a847
Compare
@fballiano Unfortunately, I'm not sure what it means to make the PR editable... What do I need to do, exactly? As far as the weird But, I do wonder what's going to happen for users that used to have the type set to "UPS" before upgrading to the new version. I don't think it'll be smooth for them- there will probably be errors as it tries to use the REST API calls with now configured auth keys and stuff. I'm not sure if we should've tried to make the upgrade transition smoother... |
it doesn't really matter if they have UPS in the configuration, UPS is the CGI API which doesn't work since months... |
4a57732
to
23878f8
Compare
23878f8
to
6ef89e1
Compare
Yeah, M2 opens a popup in this case, instead of actually using the CGI API:
But, whatever. That's getting off topic from this specific PR, anyway. Also, I think there may be a permission mismatch with my Github account and our organization, because I don't see the option to make the PR editable as shown in the link you posted. I'll have to see if I need more permissions for our org. :/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perfect
We ran into an error when getting shipping methods,
The value in question can't ever be anything besides a
string
from what I see.