I added a hook_menu function to my product_type custom module but when I go to "https://mydomain/cart/refreshcart " it says "The requested page could not be found."
I added a hook_menu function (see below) to my product_type custom module but when I go to "https://mydomain/*cart/refreshcart* " it says "The requested page could not be found.". I have directly called other urls that were defined within the hook_menu function for the ubercart/uc_cart/uc_cart.module file and they came back fine like " https://mydomain/admin/store/settings/cart". Any idea why this would not work? Thanks, John /** * Implementation of hook_menu(). */ function product_type_menu() { $items = array(); $items['*cart/refreshcart*'] = array( 'title' => 'Refresh Shopping Cart', 'description' => 'Refresh Shopping Cart', 'page callback' => 'uc_cart_block', 'access callback' => TRUE, 'type' => MENU_CALLBACK, 'file' => 'ubercart/uc_cart/uc_cart.module', ); return $items; }
Did you clear the menu cache? On Jan 30, 2011, at 2:56 PM, John Mitchell <mitchelljj98@gmail.com> wrote:
I added a hook_menu function (see below) to my product_type custom module but when I go to "https://mydomain/cart/refreshcart" it says "The requested page could not be found.". I have directly called other urls that were defined within the hook_menu function for the ubercart/uc_cart/uc_cart.module file and they came back fine like "https://mydomain/admin/store/settings/cart".
Any idea why this would not work?
Thanks,
John
/** * Implementation of hook_menu(). */
function product_type_menu() { $items = array();
$items['cart/refreshcart'] = array( 'title' => 'Refresh Shopping Cart', 'description' => 'Refresh Shopping Cart', 'page callback' => 'uc_cart_block', 'access callback' => TRUE, 'type' => MENU_CALLBACK, 'file' => 'ubercart/uc_cart/uc_cart.module', );
return $items; }
No I did not clear the menu cache. I am looking into how to do that now. On Sun, Jan 30, 2011 at 3:06 PM, Ken Rickard <agentrickard@gmail.com> wrote:
Did you clear the menu cache?
On Jan 30, 2011, at 2:56 PM, John Mitchell <mitchelljj98@gmail.com> wrote:
I added a hook_menu function (see below) to my product_type custom module but when I go to " <https://mydomain/>https://mydomain/*cart/refreshcart* " it says "The requested page could not be found.". I have directly called other urls that were defined within the hook_menu function for the ubercart/uc_cart/uc_cart.module file and they came back fine like "<https://mydomain/admin/store/settings/cart> https://mydomain/admin/store/settings/cart".
Any idea why this would not work?
Thanks,
John
/** * Implementation of hook_menu(). */
function product_type_menu() { $items = array();
$items['*cart/refreshcart*'] = array( 'title' => 'Refresh Shopping Cart', 'description' => 'Refresh Shopping Cart', 'page callback' => 'uc_cart_block', 'access callback' => TRUE, 'type' => MENU_CALLBACK, 'file' => 'ubercart/uc_cart/uc_cart.module', );
return $items; }
-- John J. Mitchell
/admin/settings/performance Click the clear cache button on the bottom of that page Best, William On Sun, Jan 30, 2011 at 3:23 PM, John Mitchell <mitchelljj98@gmail.com>wrote:
No I did not clear the menu cache. I am looking into how to do that now.
On Sun, Jan 30, 2011 at 3:06 PM, Ken Rickard <agentrickard@gmail.com>wrote:
Did you clear the menu cache?
On Jan 30, 2011, at 2:56 PM, John Mitchell <mitchelljj98@gmail.com> wrote:
I added a hook_menu function (see below) to my product_type custom module but when I go to " <https://mydomain/>https://mydomain/*cart/refreshcart* " it says "The requested page could not be found.". I have directly called other urls that were defined within the hook_menu function for the ubercart/uc_cart/uc_cart.module file and they came back fine like "<https://mydomain/admin/store/settings/cart> https://mydomain/admin/store/settings/cart".
Any idea why this would not work?
Thanks,
John
/** * Implementation of hook_menu(). */
function product_type_menu() { $items = array();
$items['*cart/refreshcart*'] = array( 'title' => 'Refresh Shopping Cart', 'description' => 'Refresh Shopping Cart', 'page callback' => 'uc_cart_block', 'access callback' => TRUE, 'type' => MENU_CALLBACK, 'file' => 'ubercart/uc_cart/uc_cart.module', );
return $items; }
-- John J. Mitchell
On 30 Jan 2011 20h23 WET, mitchelljj98@gmail.com wrote:
[1 <text/plain; ISO-8859-1 (7bit)>] No I did not clear the menu cache. I am looking into how to do that now.
You can do it in the UI or using drush (http://drupal.org/project/drush). drush cc 3 drush cc lists all the available cache bins to be cleared. IIRC devel (http://drupal.org/project/devel) has a shortcut for clearing the cache. No need do track the perfomance page for that. --- appa
Any changes to hook_menu requires cache clear. Additionally, if you are calling uc_cart_block directly, this function requires arguments to return the markup for the specific block delta, i.e. $op = 'view' $delta = 0. Please see uc_cart.module -- you may simply want to create your own callback and repurpose some of the code if you are implementing this via AHAH. On Sun, Jan 30, 2011 at 1:06 PM, Ken Rickard <agentrickard@gmail.com> wrote:
Did you clear the menu cache?
On Jan 30, 2011, at 2:56 PM, John Mitchell <mitchelljj98@gmail.com> wrote:
I added a hook_menu function (see below) to my product_type custom module but when I go to " <https://mydomain/>https://mydomain/*cart/refreshcart* " it says "The requested page could not be found.". I have directly called other urls that were defined within the hook_menu function for the ubercart/uc_cart/uc_cart.module file and they came back fine like "<https://mydomain/admin/store/settings/cart> https://mydomain/admin/store/settings/cart".
Any idea why this would not work?
Thanks,
John
/** * Implementation of hook_menu(). */
function product_type_menu() { $items = array();
$items['*cart/refreshcart*'] = array( 'title' => 'Refresh Shopping Cart', 'description' => 'Refresh Shopping Cart', 'page callback' => 'uc_cart_block', 'access callback' => TRUE, 'type' => MENU_CALLBACK, 'file' => 'ubercart/uc_cart/uc_cart.module', );
return $items; }
On 2011-01-30, at 3:30 PM, Carl Wiedemann wrote:
Any changes to hook_menu requires cache clear.
Along the same lines; is it possible to do a "selective" cache clear of the menu system? I ask as I am often running large sites locally for development, and rebuilding the menu cache can sometimes take over 2 minutes. Often, I'm just adding an access callback, or slightly changing a menu hook during development. It seems to be a waste to rebuild the whole menu system. --Andrew
You can do it manually through the database: TRUNCATE [TABLE] cache_menu then navigate to a new page and wait for the rebuild to complete. Administration menu also had individual cache clearing options in its first dropdown, afaik, however I no longer use it, so I'm not sure. - chris On 31/01/2011, at 11:58 AM, Andrew Berry wrote:
On 2011-01-30, at 3:30 PM, Carl Wiedemann wrote:
Any changes to hook_menu requires cache clear.
Along the same lines; is it possible to do a "selective" cache clear of the menu system? I ask as I am often running large sites locally for development, and rebuilding the menu cache can sometimes take over 2 minutes. Often, I'm just adding an access callback, or slightly changing a menu hook during development. It seems to be a waste to rebuild the whole menu system.
--Andrew
participants (7)
-
Andrew Berry -
António P. P. Almeida -
Carl Wiedemann -
Chris Skene -
John Mitchell -
Ken Rickard -
William Smith