FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
500 error
#1
Ben,

I am having a battle with a 500 error off http://www.thirdvoice.ca. I have run the system check and all is good. The table is id 15 and that is what is being passed to the API, at least I am pretty sure it is.

Any wisdom you can pass on?

Dave
Reply
#2
Hey Dave,

I'm pretty sure it's the form ID... glancing over the code, I can't see why it would be anything else.

An easy way to test is do some echo $form_id;exit; lines right before the API function calls to double check that the $form_id data you're passing contains what you think it does.

Feel free to post the code on the page, if you like.

- Ben
Reply
#3
    That's just the thing Ben, I am not passing a form id to the page from anywhere other than the normal formtools code at the top of the page, as this is on the home page. When I put in the code to echo the id, it shows me a blank page because there is no form id. So I really do not see where is is getting passed and id other than from the normal code:

Code:
<?php
require_once("/home/zuka/public_html/support/formtools/global/api/api.php");
//ft_api_delete_unfinalized_submissions(15, false);
$criteria = array("email" => $_POST["email"]);
$fields = ft_api_init_form_page(15);
ft_api_start_sessions();
$fields = isset($_SESSION["form_tools_form_data"]) ?
  ft_strip_tags($_SESSION["form_tools_form_data"]) : array();
$params = array(
  "submit_button" => "submit",
  "next_page" => "subscribe-thanks.php",
  "form_data" => $_POST,
  "finalize" => true
    );
ft_api_process_form($params);
?>

Form with id 15 does exist ( see attached ) so I do not know what is causing the error.

Dave
Reply
#4
Very curious! There's definitely something strange going on.

First off, why are you calling ft_api_start_sessions() after the ft_api_init_form_page() call? The second function will automatically set up sessions, so the second one may overwrite the first and lose whatever's already set. It shouldn't be necessary and could only cause problems.

Digging a bit deeper in the code, I see that the 500 error is thrown in the ft_api_create_blank_submission() function, which is called by the ft_api_init_form_page() function. So for some reason, the following line is failing. It's saying that the form ID of 15 doesn't exist.

Code:
if (!ft_check_form_exists($form_id))

Have you modified the API code at all?
Reply
#5
(Nov 12th, 2011, 11:56 AM)Ben Wrote: Very curious! There's definitely something strange going on.

First off, why are you calling ft_api_start_sessions() after the ft_api_init_form_page() call? The second function will automatically set up sessions, so the second one may overwrite the first and lose

Truthfully I don't remember as this page is from an older installation now being used with an updated FT. We might have been trying to print out some values being passed or perhaps trying to get rid of all the null dB entries. Not really are Ben but I know this was working. And no, I have not modified the API

Cheers

Dave

whatever's already set. It shouldn't be necessary and could only cause problems.

Digging a bit deeper in the code, I see that the 500 error is thrown in the ft_api_create_blank_submission() function, which is called by the ft_api_init_form_page() function. So for some reason, the following line is failing. It's saying that the form ID of 15 doesn't exist.

Code:
if (!ft_check_form_exists($form_id))

Have you modified the API code at all?

Reply
#6
(Nov 12th, 2011, 12:17 PM)filch Wrote:
(Nov 12th, 2011, 11:56 AM)Ben Wrote: Very curious! There's definitely something strange going on.

First off, why are you calling ft_api_start_sessions() after the ft_api_init_form_page() call? The second function will automatically set up sessions, so the second one may overwrite the first and lose

Truthfully I don't remember as this page is from an older installation now being used with an updated FT. We might have been trying to print out some values being passed or perhaps trying to get rid of all the null dB entries. Not really are Ben but I know this was working. And no, I have not modified the API

Cheers

Dave

whatever's already set. It shouldn't be necessary and could only cause problems.

Digging a bit deeper in the code, I see that the 500 error is thrown in the ft_api_create_blank_submission() function, which is called by the ft_api_init_form_page() function. So for some reason, the following line is failing. It's saying that the form ID of 15 doesn't exist.

Code:
if (!ft_check_form_exists($form_id))

Have you modified the API code at all?

Truthfully I don't remember as this page is from an older installation now being used with an updated FT. We might have been trying to print out some values being passed or perhaps trying to get rid of all the null dB entries. Not really are Ben but I know this was working. And no, I have not modified the API

Cheers

Dave
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)