Reply To: empty field in database not handled as expected


I believe you need to start adding debug statements to the function. Try this. In the include/smarty_plugins/function.print_if_not_empty.php file add the following code after the setting of the $class2 variable:

if ($params['label'] == "Ph.") {
    $str = "smarty_function_print_if_not_empty(): Ph is ";
    $str .= empty($params['field']) ? "empty. " : "not empty. ";
    $str .= "printIfEmpty is ";
    $str .= $printIfEmpty ? "true." : "false.";

When you print the template, you will get a message at the top of the print info screen that will tell you if it sees the phone field as empty and if it is setting the print if empty option for some reason. A not empty phone field or a true setting on the print if empty variable are the only ways that the logic will print something.

Hope this helps.