Hi guys, just a small issue with safecracker, the following works:
{if error:title}{segment_1}{/if}But this doesn’t
{if error:title}My custom error message{/if}Any ideas? Only need to do this because my ‘title’ isn’t a title, its a name
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
March 04, 2011 6:16am
Subscribe [5]#1 / Mar 04, 2011 6:16am
Hi guys, just a small issue with safecracker, the following works:
{if error:title}{segment_1}{/if}But this doesn’t
{if error:title}My custom error message{/if}Any ideas? Only need to do this because my ‘title’ isn’t a title, its a name
#2 / Mar 04, 2011 2:46pm
Hi, DaveNZ. Can you tell us which version/build of EE2.x you’re using? See EEWiki:// HowTo Determine My EE Version
Also, which version of SafeCracker are you using? Is it 2.0 or 1.3?
How about what’s in your template?
#3 / Mar 04, 2011 11:35pm
Hi Sue, Using 2.1.3, with latest version of safecracker (downloaded yesterday). The template is a pretty standard form, opening tag is:
{exp:safecracker channel="donations" return="donate/thanks/ENTRY_ID" logged_out_member_id="1594" safecracker_head="no" error_handling="inline"}#4 / Mar 06, 2011 12:11am
sorry, in my first post I mean to say that this works
{if error:title}{error:title}{/if}, not sure why I put segment_1 in there!
#5 / Mar 07, 2011 9:18am
Hi, Dave. You’ll need to have a bit of patience with us - we’re also getting used to using SafeCracker.
When I look through the code, I see the following in the SafeCracker language file:
'required' => 'The %s field is required.',which appears to be the way the error is handled. It’s an error in the title, so the text for the title is in the %s.
If you want another language key more specific only the title field being missing, a Feature Request would be the way to go.
As far as the Captcha goes, I’m going to split the thread off because that’s a separate issue.
#6 / Mar 07, 2011 9:22am
Yep I understand the lang file issue, but regardless of that you should be able to use the conditional {if error:title}{/if} or {if error:title != ''} to write your own message, if any error is returned for a particular field. Surely? Hopefully you guys got support from Barret Newton as part of the deal 😊
#7 / Mar 07, 2011 1:51pm
Hi CrescendoNZ,
It would stand to reason that the example from your first post (see below) should work. That is not the current behavior
{if error:title}My custom error message{/if}I am taking this to the team for further investigation. In the mean time you can sort of work around it by combining both steps:
{if error:title}{error:title}. Additional clarification text if needed{/if}Best regards,
Barry
#8 / Mar 07, 2011 8:32pm
Thanks Barry, hopefully its something thats relatively simple to patch. Can’t really use the workaround as my ‘title’ field is actually a name and it doesn’t make sense. So have just disabled inline error handing in the meantime
#9 / Mar 08, 2011 7:41am
Dave, I’m going to leave this thread open for the moment until we can get a definite bug report number or an explanation from Barry (one of our wonderful testing team) on what the functionality should be. Sound OK to you?
#10 / Mar 08, 2011 7:45am
Great thanks Sue!
#11 / Mar 08, 2011 10:16am
(Responding to put to the bottom of the queue, nothing substantive to add to the thread. Housekeeping post.)
#12 / Mar 08, 2011 2:40pm
Hi CrescendoNZ,
We can confirm that it is indeed a bug and we’ll have a report for you to follow shortly.
Thank you for your patience!
Best regards,
Barry
#13 / Apr 03, 2011 3:54am
Just wondering if this is fixed yet? Its been nearly a month
#14 / Apr 03, 2011 2:40pm
Hi CrescendoNZ,
There has not been another release as yet. Just so that we all get a public track of what is fixed/dealt with we would ordinarily create a Bug Report. In this case would you mind creating one for this issue? Please make sure to reference this thread.
Cheers
Greg
#15 / Apr 03, 2011 11:40pm
So it was identified as a bug on the 9th of March and only now are asking me to file a bug report? Something that simple should have been fixed by now, starting to worry about how slow EE development is - when Barret Newton owned safecracker this would have been fixed within a day or two.