I’ve been wrestling with this for a couple of days and am hoping these symptoms mean something to the MODx geniuses here.
I’ve got a simple form in a snippet that posts to itself with:
$output .= '<form action="'.'http://mydomain.com/'.'[~[*id*]~]' .'" method="post">';
When I click on "submit", rather than showing the form again, it goes to the site’s home page.
Strangely, the line in the browser window shows the correct address (the form page).
Even stranger, if I put the cursor in the address box and press enter, I get the form again (but with nothing posted to it).
If, instead, I hit refresh, I see the "repost" warning box, so I know the POST data is there but it goes to the home page again.
I have friendly URLS and friendly aliases on.
The site is in a subdirectory (actually a sub-account).
I can reach all the pages fine through the Wayfinder menu so I know the FURLs are working.
I did have the form snippet working fine at one point (I think with friendly aliases off and hardcoding the form action) so I know the snippet is ok and the POST data is present.
I have separate pages for "page not found" and "unauthorized page" -- both published and reachable from the Wayfinder menu and set in config -- but the form post never goes to them and there are no errors in the error log.
When I look at the source of the form page, the form action line looks as it should, with the correct URL of the form as the action.
Bob, baffled
UPDATE: Problem turned out to be a missing </form> tag in the snippet. Strangely, it didn’t cause a problem using the MODx default minimal template. It only went south when I switched to my own template. As always, WC3 validation is your friend!