Quote from: crosshairs at Jul 11, 2008, 10:48 AM
Hi, Bob, thanks. I tried that, and after submitting, I’m now redirected to the spformproc page, which in my case has URL:
http://mysite.org/index.php?id=4018
on this page, the following text now appears:
ResponseURL: http://mysite.org/index.php?id=4
The spformresponse page has id=4019
(don’t ask -- I started numbering new dev pages in my members area from 4000...
could it be it is only reading the first digit of the id or something??)
Actually, you’re not "redirected" to the spformproc page, you’re already there. That’s the page that contains the jump to the reponse page (which we commented out).
Your statement that you "started numbering your pages" has me wondering. MODx automatically generates the document ID numbers when you create the pages. They appear in parentheses next to the document name in the document tree at the left of the MODx manager. Did you actually create more then 4,000 documents or did you edit the document IDs in the database?
But, back to the problem.
It appears that you’ve uncovered a bug in SPForm that occurs when orig_referer is blank in the _POST.
Try replacing the last section of code in spformproc.inc.php with this:
// Redirect them to a response page
$spfResponseArg = "";
if(!empty($_POST['orig_referer'])) { // if it's there, create arg for spfresponse to take user back
$spfResponseArg .= "OrigRef=" . urlencode($_POST['orig_referer'].'"'); // needed for makeUrl
}
$responseURL = $modx->makeUrl($spfResponseID,'',$spfResponseArg,'full'); // $spfResponseID set in config file
if(!empty($_POST['orig_referer'])) {
$responseURL = substr_replace($responseURL, '', strlen($responseURL)-3); // strip trailing slash from original referrer string
}
if ($spfDebug) {
echo "ResponseURL: ".$responseURL.'<br>';
}
$modx->sendRedirect($responseURL,1);
Let me know if that fixed things.