The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Error "../../global/smarty/messages.tpl" - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5)
+--- Thread: Error "../../global/smarty/messages.tpl" (/showthread.php?tid=1612)



Error "../../global/smarty/messages.tpl" - aningbo - Sep 9th, 2011

I have the latest version downloaded. Tried downloading the api file too but i guess its the same version. I've spent over 10+ hours on this and still stuck with it!

Every time i try to use any api, i get this error shown below. I have downloaded the demo forms and it works until i add some api function:

Code:
The "[b]../../global/smarty/messages.tpl[/b]" template could not be located at the following locations: [b]/Applications/XAMPP/xamppfiles/htdocs/formtools/themes/default/../../global/smarty/messages.tpl[/b] and [b]/Applications/XAMPP/xamppfiles/htdocs/formtools/themes/default/../../global/smarty/messages.tpl.[/b]

I also realized that there's no messages.tpl under this folder ../global/smarty/. Is this some bug? I need this fixed badly since i can't get the "api_check_submission_is_unique" function. Please have a look at the earliest. I've already missed my deadline Sad

Here's the form i'm currently working on if you would like to have a look:
Code:
<?php
require_once("../global/api/api.php");
$fields = ft_api_init_form_page(3);

$errors = array();
if (isset($_POST["submit_button"]))
{
  $rules = array();
  $rules[] = "required,fullname,Please enter your name.";
  $rules[] = "required,email,Please enter your email address.";
  $rules[] = "valid_email,email,Please enter a valid email address.";
  $rules[] = "required,comments,Please enter your comments.";
  $errors = validate_fields($_POST, $rules);

$criteria = array("email" => $_POST["email"]);
if (!ft_api_check_submission_is_unique(3, $criteria, $fields["form_tools_submission_id"]))
{
  $errors[] = "Sorry, that email is already taken. Please enter another one.";
}
  // no errors - great! Now we process the page. The ft_api_process_form does
  // the job of both updating the database and redirecting to the next page
  if (empty($errors))
  {
    $params = array(
      "submit_button" => "submit_button",
      "next_page" => "thanx.php",
      "form_data" => $_POST,
"finalize" => true
    );
    ft_api_process_form($params);
  }

  // it failed validation. Update $fields with the latest contents of the form data
  else
  {
    $fields = array_merge($_SESSION["form_tools_form"], $_POST);
  }
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
  <title>Sample Form</title>
</head>
<body>

<?php
if (!empty($errors))
{
  echo "<div class='error'>Please fix the following errors:\n<ul>";
  foreach ($errors as $error)
    echo "<li>$error</li>\n";

  echo "</ul></div>";
}
?>

<form method="post" action="<?=$_SERVER["PHP_SELF"]?>">

  <table cellspacing="0" cellpadding="0">
  <tr>
    <td width="120">Name</td>
    <td><input type="text" name="fullname" value="<?=htmlspecialchars(@$fields["fullname"])?>" /></td>
  </tr>
  <tr>
    <td>Email</td>
    <td><input type="text" name="email" value="<?=htmlspecialchars(@$fields["email"])?>" /></td>
  </tr>
  <tr>
    <td>Comments</td>
    <td><textarea name="comments"><?=@$fields["comments"]?></textarea></td>
  </tr>
  </table>

  <p>
    <input type="submit" name="submit_button" value="Submit Form" />
  </p>

</form>

</body>
</html>



RE: Error "../../global/smarty/messages.tpl" - Ben - Sep 10th, 2011

Hi aningbo,

I'll look at this today. It's possible it's a bug - I *did* change the way the messages are displayed in the most recent version of the API. Keep you posted.

- Ben


RE: Error "../../global/smarty/messages.tpl" - aningbo - Sep 10th, 2011

You are a savior. I'll look forward to it Smile




RE: Error "../../global/smarty/messages.tpl" - Ben - Sep 11th, 2011

Hi Aningbo,

Sorry for the wait, releasing 2.1.2 took longer than anticipated.

So I'm just testing it out locally and didn't have any problems - but that doesn't mean there isn't a bug. Just so I'm clear: so you were able to set up the form and get it submitting to Form Tools correctly, right? I assume this because the top line $fields = ft_api_init_form_page(3); isn't initializing or sending along the test submission.

Did it just start occurring after you added the ft_api_check_submission_is_unique() function call?

- Ben


RE: Error "../../global/smarty/messages.tpl" - aningbo - Sep 11th, 2011

Problem solved after converting:

Code:
$criteria = array("email" => $_POST["email"]);
to
Code:
$criteria = array("col_2" => $_POST["email"]);

col_x was used in the database by default. Thank You Ben. Really appreciate it Smile


RE: Error "../../global/smarty/messages.tpl" - Ben - Sep 13th, 2011

No problem - and thanks for the bug report! I'll be releasing a new version of the API tomorrow that properly displays the error code - not the ugly error you spotted.

- Ben



RE: Error "../../global/smarty/messages.tpl" - mrGarvin - Sep 21st, 2011

Ah, thanks for this solution aningbo! Been having the same issue today with my form using ft_api_check_submission_is_unique()


RE: Error "../../global/smarty/messages.tpl" - Ben - Sep 22nd, 2011

Hey guys,

And in case anyone reading this thread missed it, be sure to upgrade to API 1.1.4 - that shows a much more elegant error message that explicitly tells you what to fix.

All the best -

Ben