SafeCracker / SafeCracker File custom field breaks PHP on PHP-enabled template
Posted: 17 February 2011 12:03 AM   [ Ignore ]
Is a Really Great Dancer
Avatar
RankRank
Total Posts:  97
Joined  2010-03-18

I can’t enable PHP on the template that contains my Safecracker form if the form has this in it:

{custom_fields}
  {if safecracker_file}
    {display_field}
  {
/if} 
{
/custom_fields} 

None of the PHP is parsed. If I remove that, the PHP works fine. Any ideas why putting the above lines in would kill the ability for the template to have PHP enabled?

Also, as a general question, for displaying the Safecracker File field at all, does it have to be inside the custom_fields pair? It’s the only custom field I have within that pair because I couldn’t get it to display at all otherwise.

Safecracker 1.0.3
Safecracker File 1.0.3

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 17 February 2011 12:09 AM   [ Ignore ]   [ # 1 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

PHP on input or output?

To use any field outside of the custom_fields loop, you can use the {field:your_field_name} syntax, which does the same thing {display_field} does inside the custom_fields loop. The custom_fields loop parsing can be a little wonky, so I bet using the field: syntax will solve your problem.

Profile