Page 1 of 1

contact form brocken after upgrade to 1.0.2

Posted: Wed Oct 04, 2006 1:46 am
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

Re: contact form brocken after upgrade to 1.0.2

Posted: Wed Oct 04, 2006 9:37 am
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)?

Re: contact form brocken after upgrade to 1.0.2

Posted: Thu Oct 05, 2006 1:20 am
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?

Re: contact form brocken after upgrade to 1.0.2

Posted: Mon Nov 06, 2006 8:04 pm
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.

Re: contact form brocken after upgrade to 1.0.2

Posted: Tue Nov 07, 2006 12:06 pm
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.

Re: contact form brocken after upgrade to 1.0.2

Posted: Thu Nov 23, 2006 4:26 pm
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

Re: contact form brocken after upgrade to 1.0.2

Posted: Thu Nov 23, 2006 10:03 pm
by Dr.CSS
Have you tested the CMSMailer to insure it can send emails?...

Re: contact form brocken after upgrade to 1.0.2

Posted: Thu Nov 30, 2006 10:41 am
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??

Re: contact form brocken after upgrade to 1.0.2

Posted: Thu Nov 30, 2006 6:31 pm
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

Re: contact form brocken after upgrade to 1.0.2

Posted: Tue Dec 05, 2006 12:39 pm
by teackele
changed it the way you suggested and it works for me...!

thanks!