lat9 / upsoauth

A Zen Cart UPS shipping module that makes use of UPS' RESTful/Oauth API
GNU General Public License v2.0
3 stars 3 forks source link

conditional might need to change... #12

Closed proseLA closed 1 year ago

proseLA commented 1 year ago

please do not ask me how, i have no debug logs. but i did get this error recently:

--> PHP Warning: Invalid argument supplied for foreach() in /includes/modules/shipping/upsoauth/UpsOAuthApi.php on line 378.

it seems that it would be related to this section of code:

https://github.com/lat9/upsoauth/blob/70e5ff141e1b4dcbd02194cf5ce1cc691ac40b47/includes/modules/shipping/upsoauth.php#L305-L314

a potential solution mighty be changing line 306 to:

if ($all_ups_quotes === false || empty($all_ups_quotes->RateResponse->RatedShipment)) {

but i have only seen this once.

lat9 commented 1 year ago

Thanks for the report; I'll review but you're usually correct in your assessments.