Closed GoogleCodeExporter closed 8 years ago
1. Does re-saving your permalink settings have any affect?
2. What are your permalink settings?
3. What are your post-type settings? Please export your post-type definition
to JSON and attach them here so I can review.
Original comment by ever...@fireproofsocks.com
on 12 May 2015 at 6:27
I had to delete the temporary site due to concerns of it messing with the
production site.
1) I have not tried that yet
2) Set to post name in WordPress
3) Attached
Original comment by blcoo...@gmail.com
on 26 May 2015 at 6:14
Attachments:
I have tried changing/saving/changing back/re-saving the permalink settings and
that did not fix the error. The dev site is now at
http://f09.6f6.myftpupload.com/ and I shouldn't need to remove it again as I
think I have removed and concerns of it messing with the production site.
Original comment by blcoo...@gmail.com
on 26 May 2015 at 7:49
Is blcookin the OP? FYI, links to a site (prod or dev) are generally not
helpful because I need to be able to reproduce the error locally, and looking
at rendered HTML does determine what PHP code may or may not be at work. From
the OP, I'm not sure how the CCTM is involved in the described behavior: I'm
only guessing it has to do with the minefield of WP's url mapping, but I'm
still unclear on how to reproduce the issue in isolation.
Original comment by ever...@fireproofsocks.com
on 26 May 2015 at 8:01
Yeah, same person posting here... one account is work, the other is personal. I
don't really know much about how WordPress handles mapping the URLs. I do know
that before updating the CCTM plugin the site works fine and then after
updating CCTM (and only CCTM) that the submission page shows the 404 error page
content instead of the submission page content. What else can I do/provide to
help locate the issue? I developed the site and have access to the code so I
can put in whatever debugging I need to help track down the problem.
Original comment by tk.oakmo...@gmail.com
on 26 May 2015 at 8:10
I cannot reproduce the issue with the information in this ticket. We've tried
viewing built-in and custom post types (using the .cctm.json configuration
provided), and the URL rewriting is working in all cases. What post types are
the "thank-you" and "get-approved" pages? Are they pages? Or posts? Or
custom post types?
Original comment by ever...@fireproofsocks.com
on 28 May 2015 at 6:28
Both are pages with a custom template. I have attached the templates.
Original comment by tk.oakmo...@gmail.com
on 28 May 2015 at 1:44
If you're using custom templates, does that mean those are pages and not posts
or a custom post type? Debugging the themes is outside the scope of the
plugin, but it would be useful to try changing the pages' templates to
something different and see if the problem still exists. If not, then you know
the problem lies within your template code. If yes, then there's some bit of
information here that is missing.
Original comment by ever...@fireproofsocks.com
on 28 May 2015 at 4:59
They are defined as pages, using a template I created. I changed the Thank You
page's template to be the default, and it still shows the 404 page when the
form is submitted. If I drop out the template on the form page then the form
won't be there for me to submit to get to the Thank You page. If needed I could
drop the template and hard code a form into the body of the page instead of
using the template to generate the form if you think that will help track down
the issue.
Original comment by tk.oakmo...@gmail.com
on 28 May 2015 at 5:42
As I said: you need to isolate this. The templates are beyond the scope of the
CCTM plugin. The URL functionality needs to be tested independently from your
form flow.
Original comment by ever...@fireproofsocks.com
on 28 May 2015 at 5:45
I tried manually typing in the URL of the page as well as using a standard
anchor (<a>) tag to redirect to the page and those show the correct content so
it appears that the issue is coming in the form submission, but I'm not sure
what that would be yet. The form tag code is just:
<form name="myForm" method="post" action="/thank-you" onsubmit="return
validateForm();">
The "validateForm" javascript function checks that the user has filled in the
required fields and returns true or false, which is really being done due to
older browsers and Safari not enforcing the "required" attribute of input
fields. I'll have to do some testing to figure out what's happening, but if you
see an apparent error in why the form submission would cause this please let me
know.
Original comment by tk.oakmo...@gmail.com
on 28 May 2015 at 7:20
Ok, since you've confirmed that the pages load when the URL is requested, that
means the problem is somewhere in your form logic and/or the javascript
redirects in them. Closing this issue.
Original comment by ever...@fireproofsocks.com
on 28 May 2015 at 7:45
I have figured out the issue, and it's quite annoying as to what the problem
is. The issue stems from having a field in the form named "location". With that
in there the 404 error occurs and with it removed (or renamed) the submission
works fine and the Thank You page loads correctly. So, apparently WordPress has
an issue with using location as an input that ends up in the $_POST array. Why
this reveals itself when updating the plugin is a mystery because it did not
have an issue before.
Original comment by tk.oakmo...@gmail.com
on 28 May 2015 at 8:47
I would test this separately without any extra PHP in it -- try drawing a
static HTML form and then on the thank-you action page, just do a
print_r($_POST). It's entirely possible that WP secretly reserved the field
named "location", but looking at your sample templates, I'd say there is so
much else going on in there that you'd want to isolate that to be sure.
Original comment by ever...@fireproofsocks.com
on 28 May 2015 at 8:58
I essentially did what you suggested to find the issue. I commented out nearly
everything in the thank you template except for some standard HTML code, and
then removed the form template from the other page and entered a form with a
single radio button input named "location". I then tried submitting the form
and it showed the 404 page. If I went back and changed the input name to
"myLocation" instead of "location" the submission worked fine and the correct
page is shown on submission. I hate when weird bugs like this show up in code,
and now I get to go through every template and place in the site where I used
"location" in the $_POST, $_GET, or $_SESSION and change them to a new word...
hooray.
Original comment by tk.oakmo...@gmail.com
on 28 May 2015 at 9:05
Original issue reported on code.google.com by
tk.oakmo...@gmail.com
on 12 May 2015 at 6:22