开发者

Changes in module_menu() aren't applying

I have a custom module called tf_partner. I just modified this to include another argument. Inside the module I have:

function tf_partner_menu()
{
  //... more code.....
  $items['partner/letters/word/replace/%/%/%/%'] = array(
    'page callback' => 'tf_partner_replace_image',
    'access callback' => TRUE,
    'page arguments' => array(4, 5, 6, 7),
    'type' => MENU_CALLBACK,
    'file' => 'tf_partner_letters.inc.php',
  );
  //...more code
}
This is what it used to be ...
function tf_partner_menu()
{
  //... more code.....
  $items['partner/letters/word/replace/%/%/%'] = array(
    'page callback' => 'tf_partner_replace_image',
    'access callback' => TRUE,
    'page arguments' => array(4, 5, 6),
    'type' => MENU_CALLBACK,
    'file' => 'tf_partner_letters.inc.php',
  );
  //...more code
}

function tf_partner_replace_image($aid, $letter, $position, $randstr)
{ 
  echo "here"; //doesn't show up
}

The problem is when I try to go to the new url, it doesn't work and goes to /partner/letters/word. I already went to admin/build/modules, but still getting the problem. I checked the database (menu_router table) and it looks correct.

EDIT: Also, I created a new function similar to this and a new menu item. I started with 1 argument and added one at a time. It allowed me up to 3. When I added the 4th one, it d开发者_StackOverflow社区idn't work anymore.


clear cache on admin/settings/performance or by emptying cache_{name} tables in database.

code looks fine, I guess menu just didn't get rebuilt.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜