heavenbr / wordpress-custom-content-type-manager

Automatically exported from code.google.com/p/wordpress-custom-content-type-manager
0 stars 0 forks source link

After updating to version 0.9.8.4, page is displaying 404 error. #590

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Please make sure you are including enough information to make this a valid
bug report: https://code.google.com/p/wordpress-custom-content-type-
manager/wiki/ReportingBugs

What steps will reproduce the problem? (Be *specific*)
1. Go to http://ac3.69b.myftpupload.com/ and fill out the credit application 
form on the home page. (Put in any generic data)
2. Click the "Continue" button on the form and it will redirect to 
http://ac3.69b.myftpupload.com/thank-you.

What is the expected output?
The "Thank You" page in this case is supposed to submit the form data to our 
CRM and then redirect to "http://ac3.69b.myftpupload.com/get-approved/" to 
allow the customer to finish filling out the credit application. This same 
process can be followed and correctly reviewed on www.oakmotors.com, which is 
the company's production site.

What do you see instead?
The content displayed on the "Thank You" page is the 404 error page information.

Does the problem continue if you disable all other plugins? (plugin
conflicts cause a LOT of problems, so please isolate the problem)
Yes, even with plugins disabled it still is an issue.

Please copy and paste the system information that appears in a yellow
textarea when you click on "Report a Bug" on any CCTM admin screen (this
includes the version of the
plugin, the version of PHP, the version of MySQL, a list of other active
plugins etc.):
*SYSTEM INFO* 
------------------------ 
Plugin Version: 0.9.8.4-pl
WordPress Version: 4.2.2
PHP Version: 5.4.16
MySQL Version: 5.5.37-35.0-log
Server OS: Linux
Language: WPLANG
------------------------ 
ACTIVE PLUGINS: 
 * Custom Content Type Manager : Advanced Custom Post Types v.0.9.8.4 [https://github.com/craftsmancoding/custom-content-type-manager]
 * Google Analytics by Yoast v.5.4.2 [https://yoast.com/wordpress/plugins/google-analytics/#utm_source=wordpress&utm_medium=plugin&utm_campaign=wpgaplugin&utm_content=v504]
 * Hupso Share Buttons for Twitter, Facebook & Google+ v.4.0.0 [http://www.hupso.com/share/]
 * MapPress Easy Google Maps v.2.42.1 [http://www.wphostreviews.com/mappress]
 * Slideshow v.2.2.23 [http://wordpress.org/extend/plugins/slideshow-jquery-image-gallery/]
 * Wistia WordPress Plugin v.0.7 [https://github.com/wistia/wistia-wordpress-plugin]
 * WordPress SEO v.2.1.1 [https://yoast.com/wordpress/plugins/seo/#utm_source=wpadmin&utm_medium=plugin&utm_campaign=wpseoplugin]
 * WP Crontrol v.1.2.3 [https://wordpress.org/plugins/wp-crontrol/]
------------------------ 
CURRENT THEME: Oak Motors v.1.0.0 http://www.oakmotors.com

Original issue reported on code.google.com by tk.oakmo...@gmail.com on 12 May 2015 at 6:22

GoogleCodeExporter commented 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

GoogleCodeExporter commented 8 years ago
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:

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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