So I've setup a safecracker form, all works great to submit an article and the editing page also works if you're logged in as the author. However if you're logged out you get the following message:
The form you submitted contained the following errors
You are not the author of this entry.
This is fine for the edit page and works as it should do, however when trying to simply view the article it still displays this message, any ideas why?
{if freebie_3 == ""}
{embed="site/_header" page_name="{segment_1}"}
<div class="primary-col">
{exp:channel:entries channel="profile"}
<h1>{title}</h1>
<div class="bio">
{company_bio}
</p>
<div class="work-samples">
{company_samples}
<article><img src="{image:url}" alt="{image:title}" /></article>
{/company_samples}
{/exp:channel:entries}
</div>
{if:else}
{embed="site/_header" page_name="edit"}
<h1>Your Profile</h1>
<div class="primary-col">
{if logged_out} You aren't a member or aren't logged in.<br /> <a href="{path='member/login'}">Login</a> | <a href="{path='member/register'}">Register</a> {/if}
{exp:safecracker channel="profile" author_only="yes" return="companies/URL_TITLE" url_title="{segment_2}" error_handling="inline" include_jquery="no" rte_selector=".rte"}
{edit-form}
{/exp:safecracker}
</div>
{/if}
{embed="site/_footer"}
I'm using Freebie to detect if segment_3 is empty, if it is then the article is displayed, but if segment_3 is edit then you'll get the edit form. I've tried swapping the ifs around so that if freebie_3 == "edit" but it does exactly the same thing.