Forums

Error 404 saving form

FaberM 20 Jul, 2010
Hello,
I used the forum search function but did not find anything similar...

I use Chronoforms 3.1 RC5.5. I have several forms on our website which work flawlessy, but one of them gives problems in the administration section.

When I try to save the form after some changes, or even try to save it after opening and without any changes via the "Save" button, I have the "Component not found - error 404" Joomla error.

I noticed that the problem started appearing after I continued to add php code in "form code" tag: in the section "Form html" there are almost 400 php lines, and more than 600 lines in "On submit code - before sending email". At a certain point, the form stopped working, meaning I could not save it anymore, so I think this might depend on the quantity of text to save in jos_chrono_contact fields.
Note that, if I access the DB directly - I mean editing jos_chrono_contact table directly, changing php code in fields "html" and "onsubmitcodeb4" - the component works perfectly and acts as it should, and the php code does it job fine.

EDIT: Joomla v. is 1.5.18, but the problem is still there with 1.5.19. It happened also with previous releases, starting from 1.5.15

Thank you in advance

Ciao
GreyHead 20 Jul, 2010
Hi FaberM,

There is a 'feature' in the latest ChronoForms release that tries to evaluate the form code when you save the form in the Admin. This can cause problems if there is PHP in the form. The workaround is to add this code before the first line of PHP in the Form HTML box
<?php
if ( !$mainframe->isSite() ) { return; }

?>


It could also be a memory / timeout problem. I usually 'include' any long files into the Form HTML box so that I can work on them with an FTP editor.
<?php
if ( !$mainframe->isSite() ) { return; }
include (JPATH_SITE.DS.'components'.DS.'com_chronocontact'.DS.'includes'.DS.'form_name'.DS.'formhtml.php');
?>
This is more or less the equivalent of working with the table entries but much simpler to do.

Bob
FaberM 20 Jul, 2010

The workaround is to add this code before the first line of PHP in the Form HTML box

<?php
if ( !$mainframe->isSite() ) { return; }

?>

Bob



Hello Bob,
this solved the problem, nice!

Also, I like the "include" hint, much more handy to manage, I will change it in the future.

Thanks, have a nice day!

Ciao
JeLu 12 Nov, 2010
Hi!

I have the same problem and have tried to solve it with the solution found here but it will not work. I recieve this error message:

Not Acceptable
An appropriate representation of the requested resource /administrator/index2.php could not be found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.



Any idees??

JeLu
Max_admin 14 Nov, 2010
JeLu, please try to create a simple form in the wizard and save it, if you get the same error then it may be the security settings on your web server and you may need some assistance from your host admin.

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
JeLu 14 Nov, 2010
I have tested with a new form and there is no problem. In this new form I have not added any PHP code. Can it be the code that causes my problem?

I have created a form with and without wizard.
JeLu 14 Nov, 2010
I just added the form code
<?php
if ( !$mainframe->isSite() ) { return; }
?>


And the problem was there. Is it something that has happend that has "banned" my site at my host?

What is it that I need to ask them to change?

I have used ChronoForm in severel sites now and it is a great tool that never has caused me any problem except when I have done something wrong on my own. And it worked fine at this domain until last week.
JeLu 14 Nov, 2010
This is the rest of the error I recive:
Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_jk/1.2.25 PHP/4.4.9 Server at www.adomainname.se Port 80


I see that it says something about ssl but I have not turned that on, as I am aware of. I have tried to install VitrueMart 1.5 Beta1 but it wouldn´t finsih. I reinstalled version 1.1.5 instead.
nml375 14 Nov, 2010
Hi JeJu,
The error you recieve is not related to the original poster's issue.

What you are in fact having issues with, is a security module running on the web server, which would appear to block form submissions containing PHP-code (you storing the form). This most commonly happens when admins install the mod_security module with apache, not taking the effort to set up the filter rules properly.

As for the last info posted, this is actually not part of the error message, but a description of the web server environment. SSL is mentioned as the server supports SSL, not that you would be using it.

Your best bet of sorting this, is to get in touch with your hosting company's tech department, as generally, the mod_security settings are not user-changeable.

/Fredrik
JeLu 15 Nov, 2010
OK!

Sorry to "hijack" a post like this but I really thought it was in correct. I have contacted my hosting company and waiting for answer.

I can get access to an own php.ini and change rules there. What rules should I change?

Once again apologize for me "hijacking" like this
nml375 15 Nov, 2010
Hi JeLu,
In the case of mod_security, there would usually be a log entry in the server error logfile, indicating which rule was triggered.
You could also try to completely disabling mod_security for your site using something like this in your .htaccess file:
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>


/Fredrik
This topic is locked and no more replies can be posted.