Re: Re: Re: ONE WORKAROUND SOLUTION found to this problem

Posts: 14
Joined: 09/28/2007
Bug Finder

Well, I've been looking into this further, and it looks like maybe the module has mistakenly put the "cart/checkout/shipping/quote" path in the wrong place--after reading this thread at Drupal.org, it occurred to me that this path, since it is not dynamic, needs to be in the $may_cache area of the menu hook.

So I took the whole thing, lines 69-73, and moved it up a couple lines so it began on line 67 instead and fell inside the $may_cache area.

So instead of having:

<?php
function uc_quote_menu($may_cache) {
 
$items = array();
  if (
$may_cache) {

// ... SNIP - several menu items ...

   
$items[] = array('path' => 'admin/store/settings/quotes/methods/general',
     
'title' => t('General settings'),
     
'type' => MENU_DEFAULT_LOCAL_TASK,
     
'weight' => -10,
    );
  }
  else {
   
$items[] = array('path' => 'cart/checkout/shipping/quote',
     
'access' => user_access('access content'),
     
'callback' => 'uc_quote_request_quotes',
     
'type' => MENU_CALLBACK,
    );
   
drupal_add_css(drupal_get_path('module', 'uc_quote') .'/uc_quote.css', 'module');
  }
  return
$items;
}
?>

I now have:

<?php
function uc_quote_menu($may_cache) {
 
$items = array();
  if (
$may_cache) {

// ... SNIP - several menu items ...

   
$items[] = array('path' => 'admin/store/settings/quotes/methods/general',
     
'title' => t('General settings'),
     
'type' => MENU_DEFAULT_LOCAL_TASK,
     
'weight' => -10,
    );
   
$items[] = array('path' => 'cart/checkout/shipping/quote',
     
'access' => user_access('access content'),
     
'callback' => 'uc_quote_request_quotes',
     
'type' => MENU_CALLBACK,
    );
  }
  else {
   
drupal_add_css(drupal_get_path('module', 'uc_quote') .'/uc_quote.css', 'module');
  }
  return
$items;
}
?>

Now, once again, the shipping quotes are working in checkout and the 404 is averted. I don't know whether this is a permanent solution; I will report back on whether it sticks. Any thoughts?

USPS quote works fine in cart, but fails on checkout By: Vallenwood (6 replies) Tue, 04/29/2008 - 02:47