Greetings, all. I am new to Drupal, working on my first module. I am having an issue that I can't seem to see where my issue is. Here is the flow: function alldotdev_advsearch_groups_form_submit($form_id, $form_values) { $op = $form_values['op']; $pagerrows = 50; if ($op == t('Non-Standard Results')) { $query_field = t('nonstd'); $query_value = $form_values['nonstd']; } $query_string = $query_field . " = '" . $query_value . "'"; return "AllDotDev/alldotdev_groups_display/" . $query_string . "/" . $pagerrows; } function alldotdev_groups_display($query_string = "", $pagerrows = '50') { $page_content = ''; $header = alldotdev_wholeheader(); $rows = alldotdev_groupsquery($query_string,$pagerrows); $pager = theme('pager', NULL, $pagerrows, 0); if (count($rows) && !empty($pager)) { $rows[] = array(array('data' => $pager, 'colspan' => count($rows[0]))); } if (count($rows)) { $page_content .= theme('table', $header, $rows); } else { $page_content .= "No devices meet the selection criteria"; } print theme('page', $page_content); } function alldotdev_groupsquery($query_string, $pagerrows = 50) { $header = alldotdev_wholeheader(); db_set_active('alldotdev'); $alldotdev_alldbfields = array_keys(alldotdev_allfields()); $fields = implode(",", $alldotdev_alldbfields); //$query = "SELECT " . $fields ." FROM devices WHERE " . $query_field . " = '" . $query_value . "'"; $query = "SELECT " . $fields ." FROM devices WHERE " . $query_string; $query .= tablesort_sql($header); //drupal_set_message($query); $query_result = pager_query($query, $pagerrows, 0, NULL, $query_string); db_set_active('default'); while ($record = db_fetch_object($query_result)) { $values = array(); foreach ($alldotdev_alldbfields as $value) { $values[] = $record->$value; } $rows[] = $values; } return $rows; } When I click one of the radio buttons for "nonstd" (which gives true or false), the application thinks about it for a second or two, then brings me back to the page that is listed in the menus as MENU_DEFAULT_LOCAL_TASK instead of the page that I am asking for in my functions (alldotdev_groups_display). I don't follow the Drupal flow (as of this point) enough to know where to look to fix this issue. Could someone please point me in a direction to get this issue resolved? Thank you kindly! Chris Ivey Affiliated Computer Services Enterprise Management Integration Services Infrastructure Management Senior Analyst chris.ivey@acs-inc.com "I have not failed, I have simply found 10,000 ways which do not work!" -- Thomas Edison "When you find yourself in a hole, the best thing to do is stop digging!" -- Nick Stokes "I reject your reality, and substitute my own!" -- Adam Savage
A guess From the code you show I am guessing you are using the form_alter hook to modify an existing form and add an addition submit button and well as a custom submit handler. Since only one of the submit handlers can actually return a path (a least only one is used), if my guess is correct try replacing your return at the end of the submit function with $_REQUEST['destination'] = "AllDotDev/alldotdev_groups_display/" . $query_string . "/" . $pagerrows; Steve Ringwood Nevets Software
participants (2)
-
Ivey, Chris -
Steve Ringwood