I've been staring at this an hour now...time go ask for help! I have two reports. The menu entries are below. Each works. They are identical other than name. At the top of each, I provide a button to request a CSV. The report's callback checks for the get value associated with the button. The buttons are each submits. The action for the form in each report is the final part of the callback path. Report 1 successfully returns to the callback function for it. Report 2, when the button is clicked, just spins and spins. If I change the action in report 2 to 'customers'... it finds its way to that callback function, but can't seem to find its own. Of course, the callback function is found when simply clicking on the menu link for the report...so I'm thinking it's the form action...but can't figure it out.

function my_reports_menu() {
  global $user;
  $items = array();
  $items['admin/store/reports/my/customer'] = array(
    'title' => 'Customers',
    'description' => 'Customer name and address list',
    'page callback' => 'my_reports_customers',
    'access arguments' => array('view reports'),
    'type' => MENU_NORMAL_ITEM,
    'weight' => 10,
  );
  $items['admin/store/reports/my/orders'] = array(
    'title' => 'Orders today',
    'description' => 'Orders placed today',
    'page callback' => 'my_reports_orders',
    'access arguments' => array('view reports'),
    'type' => MENU_NORMAL_ITEM,
    'weight' => 10,
  );
}

From report that doesn't work

$output .= '<div><form id="csv" action="orders" method="get" /><input type="hidden" name="csv" value="true" /><input type="submit" value="CSV" style="background-color: gold" /></form></div>';

The one that does work ...and if the action above is changed to 'customer' as below, it gets processed

$output .= '<div><form id="csv" action="customer" method="get" /><input type="hidden" name="csv" value="true" /><input type="submit" value="CSV" style="background-color: gold" /></form></div>';

Reply via email to