verbb / postie

A Craft Commerce shipping calculator plugin.
Other
12 stars 18 forks source link

In UPS Provider, if services defined in settings, and S_SURE_POST not enabled, undefined index error #35

Closed GaryReckard closed 4 years ago

GaryReckard commented 4 years ago

I am defining the UPS services that are enabled in my postie.php config. I am not enabling S_SURE_POST, so that is not included in my list of services.

I am getting an undefined index error at https://github.com/verbb/postie/blob/6689e598d064f2852dc3f9194b2aa01b790db52f/src/providers/UPS.php#L272

I think this just needs an isset check first.

rsanchez commented 4 years ago

Same issue here.

zachisit commented 4 years ago

Same issue on my end. Seeking help!

GaryReckard commented 4 years ago

I found a temporary workaround, using this undocumented feature of providing an array for the provider services rather than just a string name, in postie.php config. So, adding this to my config:

'S_SURE_POST' => [ 'name' => 'Sure Post', 'enabled' => false, ],

gets around the bug.

(the ability to provide both name and enabled status in an array in config should be mentioned on https://verbb.io/craft-plugins/postie/docs/get-started/configuration)

santiDotIO commented 4 years ago

Running into the same issue

engram-design commented 4 years ago

Sorry all, fixed in 2.2.5