我有一个“烘焙”cakePHP-3.0.0页,其中有一个字段定义为
date_of_birth date DEFAULT NULL在表users中。
当我单击提交的add函数时,我得到
警告(2):preg_match()期望参数2是string,数组给定CORE\src\Validation\Validation.php,第763行代码上下文 保护静态函数_check( $check,$regex) { if (is_string($regex) & preg_match($regex,$check)) {$check=‘=>’2014,‘月’=> '01',)(- '%^(?:(?:(?:(?:(?:16-9|2-9\d)?(?:048|2468|13579)|(?:(?:16| .)(?:0?2\1(?:29))(?:(?:(?):(?){2}(- /.)(?:(?:(?:0?13578|102)\2(?:31))|(?:(?:0?1,3-9|10-2) \2(29|30))|(?:(?:0?1-9)|(?:10-2))\2(?:0?1-9|1\d|20-8))))$%‘)
对如何修复有什么建议吗?
The stack trace is preg_match - [internal], line ??
Cake\Validation\Validation::_check() - CORE\src\Validation\Validation.php, line 763
Cake\Validation\Validation::date() - CORE\src\Validation\Validation.php, line 346
Cake\Validation\RulesProvider::__call() - CORE\src\Validation\RulesProvider.php, line 53
Cake\Validation\RulesProvider::date() - CORE\src\Validation\ValidationRule.php, line 138
Cake\Validation\ValidationRule::process() - CORE\src\Validation\ValidationRule.php, line 138
Cake\Validation\Validator::_processRules() - CORE\src\Validation\Validator.php, line 554
Cake\Validation\Validator::errors() - CORE\src\Validation\Validator.php, line 128
Cake\ORM\Marshaller::_validate() - CORE\src\ORM\Marshaller.php, line 185
Cake\ORM\Marshaller::merge() - CORE\src\ORM\Marshaller.php, line 341
Cake\ORM\Table::patchEntity() - CORE\src\ORM\Table.php, line 1899
App\Controller\UsersController::add() - APP/Controller\UsersController.php, line 48
Cake\Controller\Controller::invokeAction() - CORE\src\Controller\Controller.php, line 406
Cake\Routing\Dispatcher::_invoke() - CORE\src\Routing\Dispatcher.php, line 114
Cake\Routing\Dispatcher::dispatch() - CORE\src\Routing\Dispatcher.php, line 87 发布于 2015-01-08 21:46:33
请阅读https://github.com/cakephp/cakephp/issues/5611#issuecomment-69254634的答案
问题已经解决,请使用"composer更新“更新您的cakephp版本。
请注意,您必须在composer中使用dev-master,直到新版本被标记为止。
https://stackoverflow.com/questions/27845581
复制相似问题