OK, I think I fixed it by logging from Zend_Loader::isReadable() to find out
what was wrong, but it makes no sense.

Basically, my custom validators folder cannot be called "Validate", anything
but "Validate" works, because somehow "Validate/" seems to be being mapped
to "Zend/Validate/" and is opening a successful stream to
Zend/Validate/StringLength.php before it has gotten to the Zend_Validate
$prefix, but that's impossible with my include paths.

get_include_paths() from inside Zend_Loader:isReadable() returns:
.;../lib;../app/models;../app/forms

So how does it successfully open "Validate/StringLength.php" when the path
required to that file is "Zend/Validate/StringLength.php"? Weird.


Matthew Weier O'Phinney-3 wrote:
> 
> -- KyleMac <[EMAIL PROTECTED]> wrote
> (on Wednesday, 02 July 2008, 02:12 PM -0700):
>> 
>> Here's a pastebin: http://pastebin.com/m75ddcc6b
>> 
>> BaseForm usually contains my standard decorators and so on, but I've
>> removed
>> all that to try and find the problem. AlnumExtra is my custom validator.
> 
> The problem is in your BaseForm class -- you never call
> parent::__construct(), and so the default paths are never setup
> correctly. Move that functionality into init(), and have your extending
> classes call parent::init() at the start of their init() methods.
> 
>> The case sensitivity problem is what I brought up here and exists in
>> 1.5+:
>> http://www.nabble.com/Mixed-case-controller-names-spaces-in-controller-names-to16886114.html#a16907959
>> 
>> Zend_Controller has been built on the assumption that PHP is case
>> sensitive
>> with class names, but PHP is not. Zend_Controller is in fact relying on
>> case
>> sensitivity from the file system, which NTFS doesn't have. So with ZF
>> 1.5+
>> on a Window servers, both /privacy-policy and /privacypolicy will load
>> the
>> PrivacyPolicyController.php but will fail loading the view folder.
> 
> So use /privacy-policy in the URL and not /privacypolicy. The second
> should map to PrivacypolicyController.php anyways, which should fail to
> load as class names are case SENSITIVE.
> 
> The easiest fix for case sensitivity is to use the appropriate URLs.
> 
> 
>> Matthew Weier O'Phinney-3 wrote:
>> > 
>> > -- KyleMac <[EMAIL PROTECTED]> wrote
>> > (on Wednesday, 02 July 2008, 01:20 PM -0700):
>> >> I just can't get custom validators to work properly. I want to be able
>> >> to use the validators in addElement with the shorthand name, i.e. just
>> >> "Regex".
>> >> 
>> >> The closet I can get to them working is:
>> >> 
>> >> $form->addElementPrefixPath('KM_Validate', 'Validate/',
>> >> Zend_Form_Element::VALIDATE);
>> >> 
>> >> But now none of the Zend validators work, for example: 'File
>> >> NotEmpty.php was loaded but class named KM_Validate_NotEmpty was not
>> >> found within it.' So it is still looking in Zend/Validate but is not
>> >> trying the correct class prefix.
>> > 
>> > Can you provide the full form definition, possibly in a pastebin
>> > somewhere? There are tests for this exact situation, and I've written
>> > applications and tutorials that do exactly this without any problems.
>> My
>> > inclination is that there is something else in your form definition
>> > causing problems.
>> > 
>> >> PS. Is the case sensitivity problem in Zend_Controller on NTFS going
>> >> to be fixed? If my production server ran Windows I'd consider it a
>> >> show stopper.
>> > 
>> > What case sensitivity issue are you referring to?
>> > 
>> > -- 
>> > Matthew Weier O'Phinney
>> > Software Architect       | [EMAIL PROTECTED]
>> > Zend Framework           | http://framework.zend.com/
>> > 
>> > 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/Zend_Form-addElementPrefixPath-disables-Zend-Validators-tp18245929p18246899.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>> 
> 
> -- 
> Matthew Weier O'Phinney
> Software Architect       | [EMAIL PROTECTED]
> Zend Framework           | http://framework.zend.com/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Zend_Form-addElementPrefixPath-disables-Zend-Validators-tp18245929p18248789.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to