[fw-general] Re: Zend_Captcha custom error message question

2009-01-27 Thread Deepak Shrestha
Ok,

 I found a Warning displayed at to of my form after validation.

The Message:
=
Warning: htmlspecialchars() expects parameter 1 to be string, array
given in C:\WEB\myweb\library\Zend\View\Abstract.php on line 804


What does this mean?

Thanks

-- 
===
Registered Linux User #460714
Currently Using Fedora 8, 10
===


[fw-general] Re: Zend_Captcha custom error message question

2009-01-28 Thread Deepak Shrestha
On Wed, Jan 28, 2009 at 3:23 PM, Deepak Shrestha  wrote:
> Ok,
>
>  I found a Warning displayed at top of my form after validation.
>
> The Message:
> =
> Warning: htmlspecialchars() expects parameter 1 to be string, array
> given in C:\WEB\myweb\library\Zend\View\Abstract.php on line 804
> 
>
> What does this mean?
>

If custom message is removed, form displays the error message "Captcha
value is wrong". I have tried addErrorMessage() and setErrorMessages()
with no luck.

Thanks again
-- 
===
Registered Linux User #460714
Currently Using Fedora 8, 10
===


[fw-general] Re: Zend_Captcha custom error message question

2009-01-28 Thread Deepak Shrestha
Hi, me again

it is solved now by doing this

==
$captchaimg->setMessage("My Custom Message", 'badCaptcha');
==

This came to my mind only after I did some digging around and had a
look at the code
'Zend/captcha/Word.php' (ancestor class)

Where the message template and keywords are defined

=
const MISSING_VALUE = 'missingValue';
const MISSING_ID= 'missingID';
const BAD_CAPTCHA   = 'badCaptcha';
/*...@-*/

/**
 * Error messages
 * @var array
 */
protected $_messageTemplates = array(
self::MISSING_VALUE => 'Empty captcha value',
self::MISSING_ID=> 'Captcha ID field is missing',
self::BAD_CAPTCHA   => 'Captcha value is wrong',
);

==

Thanks anyway


-- 
===
Registered Linux User #460714
Currently Using Fedora 8, 10
===