controller->isModal()) { // we check whether *all* pages up to current are valid // if there is an invalid page we go to it, instead of the // requested one $pageName = $page->getAttribute('id'); if (!$page->controller->isValid($pageName)) { $pageName = $page->controller->findInvalid(); } $current = &$page->controller->getPage($pageName); } else { $current = &$page; } // generate the URL for the page 'display' event and redirect to it $action = $current->getAttribute('action'); $url = $action . (FALSE === strpos($action, '?') ? '?' : '&') . $current->getButtonName('display') . '=true' . '&qfKey=' . $page->get('qfKey'); CRM_Utils_System::redirect($url); } }