what is the correct way to check a checkbox value in Smarty in PDF Manager on Sugar v12?

Finally got my TST environment to Enterprise v12 and my PDF Templates are not working..

In PDF manager I have some templates that depend on checkboxes on the record.

For example something like:

{if $fields.mycheckbox_c} do something because it's True {else} do something else because it's False {/if}

This works just fine up to v11.x Pro but breaks in v12 Ent and never prints the "True" part of the statement regardless of the checkbox value.

When I try to print the field value:

{$fields.mycheckbox_c}

it won't print at all

And when I look at the list of available fields to use in the PDF manager, it looks like checkboxes are not there at all.

How can I use a checkbox as a control mechanism for my PDF manager then?

Thanks,
Francesca

PS. I had a similar problem moving from v9 to v10 but sadly did not make a note of how I solved it.

Parents
  • Turns out it's not just checkboxes and I am reporting this as a bug.

    PDFManagerHelper in v12 limits the types of fields whose values are passed to PDFManager

    A quick demonstration of the bug:

    Choose a module with a checkbox field

    Create a PDF that prints the checkbox field's value

    Print the PDF, no value is printed.

    Make a non-upgrade safe change to function parseBeanFields in modules/PdfManager/PdfManagerHelper.php

    add an else at the end of the elseif statements for various bean types to allow for all other field type values to be also passed:

    } else {
      $fields_module[$name] = $value;
    }



    Reload the same record you tested on and print the same PDF you created above, this time the checkbox value is printed.

Reply
  • Turns out it's not just checkboxes and I am reporting this as a bug.

    PDFManagerHelper in v12 limits the types of fields whose values are passed to PDFManager

    A quick demonstration of the bug:

    Choose a module with a checkbox field

    Create a PDF that prints the checkbox field's value

    Print the PDF, no value is printed.

    Make a non-upgrade safe change to function parseBeanFields in modules/PdfManager/PdfManagerHelper.php

    add an else at the end of the elseif statements for various bean types to allow for all other field type values to be also passed:

    } else {
      $fields_module[$name] = $value;
    }



    Reload the same record you tested on and print the same PDF you created above, this time the checkbox value is printed.

Children
No Data