Index: /branches/1.0/test/functional/validationTest.php =================================================================== --- /branches/1.0/test/functional/validationTest.php (revision 3168) +++ /branches/1.0/test/functional/validationTest.php (revision 8922) @@ -138,2 +138,41 @@ checkResponseElement('body ul[class="errors"] li[class="input4"]', 'Required') ; + +// check that /validation/index and /validation/Index both uses the index.yml validation file (see #1617) +// those tests are only relevant on machines where filesystems are case sensitive. +$b-> + post('/validation/index')-> + isStatusCode(200)-> + isRequestParameter('module', 'validation')-> + isRequestParameter('action', 'index')-> + isResponseHeader('X-Validated', 'ko') +; + +$b-> + post('/validation/Index')-> + isStatusCode(200)-> + isRequestParameter('module', 'validation')-> + isRequestParameter('action', 'Index')-> + isResponseHeader('X-Validated', 'ko') +; + +$b-> + post('/validation/INdex')-> + isStatusCode(404) +; + +$b-> + post('/validation/index2')-> + isStatusCode(200)-> + isRequestParameter('module', 'validation')-> + isRequestParameter('action', 'index2')-> + isResponseHeader('X-Validated', 'ko') +; + +$b-> + post('/validation/Index2')-> + isStatusCode(200)-> + isRequestParameter('module', 'validation')-> + isRequestParameter('action', 'Index2')-> + isResponseHeader('X-Validated', 'ko') +; Index: /branches/1.0/test/functional/fixtures/project/apps/frontend/modules/validation/actions/actions.class.php =================================================================== --- /branches/1.0/test/functional/fixtures/project/apps/frontend/modules/validation/actions/actions.class.php (revision 3168) +++ /branches/1.0/test/functional/fixtures/project/apps/frontend/modules/validation/actions/actions.class.php (revision 8922) @@ -13,8 +13,29 @@ public function executeIndex() { + if (sfWebRequest::POST == $this->getRequest()->getMethod()) + { + $this->getResponse()->setHttpHeader('X-Validated', 'ok'); + } } public function handleErrorIndex() { + $this->getResponse()->setHttpHeader('X-Validated', 'ko'); + + return sfView::SUCCESS; + } + + public function executeIndex2() + { + if (sfWebRequest::POST == $this->getRequest()->getMethod()) + { + $this->getResponse()->setHttpHeader('X-Validated', 'ok'); + } + } + + public function handleErrorIndex2() + { + $this->getResponse()->setHttpHeader('X-Validated', 'ko'); + return sfView::SUCCESS; } Index: /branches/1.0/test/functional/fixtures/project/apps/frontend/modules/validation/validate/Index2.yml =================================================================== --- /branches/1.0/test/functional/fixtures/project/apps/frontend/modules/validation/validate/Index2.yml (revision 8922) +++ /branches/1.0/test/functional/fixtures/project/apps/frontend/modules/validation/validate/Index2.yml (revision 8922) @@ -0,0 +1,22 @@ +methods: + post: + - fake + - id + - "article[title]" + - "article[body]" + +fillin: + enabled: on + +names: + fake: + required: yes + + id: + required: yes + + "article[title]": + required: yes + + "article[body]": + required: yes Index: /branches/1.0/lib/filter/sfExecutionFilter.class.php =================================================================== --- /branches/1.0/lib/filter/sfExecutionFilter.class.php (revision 7791) +++ /branches/1.0/lib/filter/sfExecutionFilter.class.php (revision 8922) @@ -72,10 +72,24 @@ $validated = true; + // the case of the first letter of the action is insignificant // get the current action validation configuration - $validationConfig = $moduleName.'/'.sfConfig::get('sf_app_module_validate_dir_name').'/'.$actionName.'.yml'; + $validationConfigWithFirstLetterLower = $moduleName.'/'.sfConfig::get('sf_app_module_validate_dir_name').'/'.strtolower(substr($actionName, 0, 1)).substr($actionName, 1).'.yml'; + $validationConfigWithFirstLetterUpper = $moduleName.'/'.sfConfig::get('sf_app_module_validate_dir_name').'/'.ucfirst($actionName).'.yml'; + + // determine $validateFile by testing both the uppercase and lowercase + // types of validation configurations. + $validateFile = null; + if (!is_null($testValidateFile = sfConfigCache::getInstance()->checkConfig(sfConfig::get('sf_app_module_dir_name').'/'.$validationConfigWithFirstLetterLower, true))) + { + $validateFile = $testValidateFile; + } + else if (!is_null($testValidateFile = sfConfigCache::getInstance()->checkConfig(sfConfig::get('sf_app_module_dir_name').'/'.$validationConfigWithFirstLetterUpper, true))) + { + $validateFile = $testValidateFile; + } // load validation configuration // do NOT use require_once - if (null !== $validateFile = sfConfigCache::getInstance()->checkConfig(sfConfig::get('sf_app_module_dir_name').'/'.$validationConfig, true)) + if (!is_null($validateFile)) { // create validator manager