I’m experiencing an odd bug in a safecracker:
The specific field I’m testing is a Safecracker File custom field (that I am filling with images only)
I thought that this may be related to the File field variable pair bug, but I have implemented the bug repair and the problem persists. (Same is true with the File Upload Prefs bug)
For this example, the “account_photo” field contains a photo
{exp:safecracker
channel='{zoo_visitor_channel_name}'
entry_id='{zoo_visitor_id}'
include_jquery="no"
safecracker_head="yes"
preserve_checkboxes="yes"}
{if account_photo}
PHOTO IS GOOD
{field:account_photo}
{if:else}
NO PHOTO
{field:account_photo}
{/if}
{/exp:safecracker}The result of the above: “NO PHOTO”
{exp:safecracker
channel='{zoo_visitor_channel_name}'
entry_id='{zoo_visitor_id}'
include_jquery="no"
safecracker_head="yes"
preserve_checkboxes="yes"}
{account_photo}
{if account_photo}
PHOTO IS GOOD
{field:account_photo}
{if:else}
NO PHOTO
{field:account_photo}
{/if}
{/exp:safecracker}The result of above is “PHOTO IS GOOD” (in addition to the output of the {account_photo} variable)
...
Am I testing the presence of content in account_photo correctly? I also tried {if account_photo != ''} with identical results…
has anyone else experienced this?
EE 2.4.0
MSM
(perhaps related to this thread?)
Note that I’ve temporarily patched my situation by adding my custom fields inside HTML comments within the safecracker form:
<!--
{account_photo}
-->