There are many calls to module_invoke_all('uc_shipping_method') spread throughout the code; some or all of these should all be switched out for calls to uc_quote_methods().

Using module_invoke_all('uc_shipping_method') gets all quote and all shipping methods. Any calling function will want only one or the other. Using uc_quote_methods() gets only the currently-active quote methods, and sorts them by weight besides. It's also better use of the API and more portable in the case of major code reworks (for which the shipping module is a possible candidate).

Comments

Dan Z’s picture

Invocations are listed at http://api.ubercart.me/api/drupal/ubercart!shipping!uc_quote!uc_quote.ap....

I'll assign myself to this because I'm willing to do this. However, it may take months for me to get to, so anyone else is free to pick it up.

There should also be a parallel uc_shipping_methods() function to eliminate the rest of the module_invoke_all('uc_shipping_method') calls.

SilviuChingaru’s picture

Assigned: Dan Z » SilviuChingaru
SilviuChingaru’s picture

Assigned: SilviuChingaru » Unassigned
Issue summary: View changes
TR’s picture

Component: Shipping » Shipping (Fulfillment)

For D8 we have already defined plugins for quote methods, need to do the same now with shipping methods. They won't be handled by the same plugins, so we won't have this issue.

Still needs to be addressed in D7 though.