contact form brocken after upgrade to 1.0.2

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
h2o

contact form brocken after upgrade to 1.0.2

Post by h2o »

Hi,

I upgraded form 0.13 to 1.0.2  and now the contact us form wont work.

The form shows up but when I hit submit I get a 404.  :-\

Must be missing a file ???

Any suggestions?

Thanks
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm

Re: contact form brocken after upgrade to 1.0.2

Post by Dee »

That's odd, I tried the contact_form tag and it works fine here.
Where does it redirect you to (that you get a 404)?
Last edited by Anonymous on Wed Oct 04, 2006 9:51 am, edited 1 time in total.
h2o

Re: contact form brocken after upgrade to 1.0.2

Post by h2o »

Dee wrote: That's odd, I tried the contact_form tag and it works fine here.
Ye I don't understand either because the form shows up.

The end of the url looks like /index.php/contact_us?
Where does it redirect you to (that you get a 404)?
I get the 404 page: 404 Looks like this page has been lost.

Is it supposed to go to another page?
Last edited by h2o on Thu Oct 05, 2006 1:21 am, edited 1 time in total.
arwecdjc

Re: contact form brocken after upgrade to 1.0.2

Post by arwecdjc »

I noticed the same on a 1.0.2 installation. Everything worked fine with 0.13, but broke with the 1.0.2 installation. I get the same 404 error pressing the submit button.

The problem seems to be related to the pretty urls. With $config['internal_pretty_urls'] = false; everything is working fine in 1.0.2, no 404 error message. So if you don't need the pretty urls, deactivate them.

If you need the pretty urls, another workaround could be using the the "function.contact_form.php" from 0.13 which seems to be working fine with 1.0.2 and pretty urls.
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm

Re: contact form brocken after upgrade to 1.0.2

Post by Dee »

The contact_form plugin is fixed in SVN:
http://viewsvn.cmsmadesimple.org/viewsv ... 9&view=rev

The latest version can be downloaded here.
zebulon
Forum Members
Forum Members
Posts: 37
Joined: Sun Aug 27, 2006 8:21 pm

Re: contact form brocken after upgrade to 1.0.2

Post by zebulon »

Dee wrote: The contact_form plugin is fixed in SVN:
http://viewsvn.cmsmadesimple.org/viewsv ... 9&view=rev

The latest version can be downloaded here.
Thanks a lot for this, folks!

However, after installing the latest version I'm still getting the Sorry, the message was not sent. The server may be down! message from line 95.

I first noticed, that when getting a 404, the reason was because the FORM ACTION was missing the initial index.php/ as I am using pretty URLS. The URL to my ContactForm is /index.php/Kontakt/kontakt_katalogbestellung.html and the Form Action is built with the $action

So I exchanged action tag within the function.contact_form.php and instead of having in line 110 I now have <form action="index.php/Kontakt/kontakt_katalogbestellung.html". But still, I get an error message saying:

Sorry, the message was not sent. The server may be down!

Anybody have a clue?

Here's the corresponding part of the config:

#------------
#URL Settings
#------------

#Show mod_rewrite URLs in the menu?
$config['assume_mod_rewrite'] = false;

#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '.html';

#If you don't use mod_rewrite, then would you like to use the built-in
#pretty url mechanism?  This will not work with IIS and the {metadata} tag
#should be in all of your templates before enabling.
$config['internal_pretty_urls'] = true;

#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy?  (ex. http://www.mysite.com/parent/parent/childpage&#41;
$config['use_hierarchy'] = true;

#If using none of the above options, what should we be using for the query string
#variable?  (ex. http://www.mysite.com/index.php?page=somecontent&#41;
$config['query_var'] = 'page';


Any help is greatly apprechiated!

cheers,
Zebulon
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: contact form brocken after upgrade to 1.0.2

Post by Dr.CSS »

Have you tested the CMSMailer to insure it can send emails?...
teackele

Re: contact form brocken after upgrade to 1.0.2

Post by teackele »

i'm using internal pretty url's as well since of today
the svn fix for the contactform did not work for me...
changed the following line in function.contact_form.php
fix works with internal pretty urls... haven't checked if its broken with normal url's

before:
if (isset($_SERVER['PHP_SELF'])) {
  $action = $_SERVER['PHP_SELF'];
}
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != '') {
  $action .= '?'.$_SERVER['QUERY_STRING'];
}

after:
if (isset($_SERVER['PHP_SELF'])) {
  $action = $_SERVER['REQUEST_URI'];
}
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != '') {
  $action .= '?'.$_SERVER['QUERY_STRING'];
}


how to get this in the devtree??
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm

Re: contact form brocken after upgrade to 1.0.2

Post by Dee »

teackele wrote: fix works with internal pretty urls... haven't checked if its broken with normal url's
It is broken actually... it takes the REQUEST_URI (for example index.php?page=contact) and adds the QUERY_STRING, resulting in an invalid URL: index.php?page=contact?page=contact
Try this instead:

Code: Select all

if (isset($_SERVER['REQUEST_URI'])) 
{
  $action = $_SERVER['REQUEST_URI'];
}
else                                                                                                                                          
{                                                                                                                                             
  $action = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : '';
  if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != '') {
    $action .= '?'.$_SERVER['QUERY_STRING'];                                                                                              
  }                                                                                                                                         
}      
teackele wrote: how to get this in the devtree??
Normally: submit your patch in the core (or some module) tracker.
Post a message here if these changes work for you - then I'll add them to SVN.

Regards,
D
teackele

Re: contact form brocken after upgrade to 1.0.2

Post by teackele »

changed it the way you suggested and it works for me...!

thanks!
Locked

Return to “CMSMS Core”