We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error can be avoided by removing getRules function in the PostForm. but then there will be no validation available. ****
Stack Trace Error: Call to protected Yiisoft\Validator\Rule::__construct() from context 'App\Blog\Post\PostForm' in C:\wamp64\www\yii3-1206\src\Blog\Post\PostForm.php:40 Stack trace: #0 C:\wamp64\www\yii3-1206\vendor\yiisoft\validator\src\Validator.php(36): App\Blog\Post\PostForm->getRules() #1 C:\wamp64\www\yii3-1206\src\Blog\Post\PostController.php(58): Yiisoft\Validator\Validator->validate(Object(App\Blog\Post\PostForm)) #2 [internal function]: App\Blog\Post\PostController->add(Object(HttpSoft\Message\ServerRequest), Object(Yiisoft\Validator\Validator), Object(App\Handler\NotFoundHandler)) #3 C:\wamp64\www\yii3-1206\vendor\yiisoft\injector\src\Injector.php(66): ReflectionFunction->invokeArgs(Array) #4 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareFactory.php(89): Yiisoft\Injector\Injector->invoke(Object(Closure), Array) #5 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(100): class@anonymous->process(Object(HttpSoft\Message\ServerRequest), Object(App\Handler\NotFoundHandler)) #6 C:\wamp64\www\yii3-1206\vendor\yiisoft\auth\src\Middleware\Authentication.php(57): class@anonymous->handle(Object(HttpSoft\Message\ServerRequest)) #7 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(100): Yiisoft\Auth\Middleware\Authentication->process(Object(HttpSoft\Message\ServerRequest), Object(class@anonymous)) #8 C:\wamp64\www\yii3-1206\vendor\yiisoft\data-response\src\Middleware\FormatDataResponse.php(25): class@anonymous->handle(Object(HttpSoft\Message\ServerRequest)) #9 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(100): Yiisoft\DataResponse\Middleware\FormatDataResponse->process(Object(HttpSoft\Message\ServerRequest), Object(class@anonymous)) #10 C:\wamp64\www\yii3-1206\vendor\yiisoft\csrf\src\CsrfMiddleware.php(50): class@anonymous->handle(Object(HttpSoft\Message\ServerRequest)) #11 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(100): Yiisoft\Csrf\CsrfMiddleware->process(Object(HttpSoft\Message\ServerRequest), Object(class@anonymous)) #12 C:\wamp64\www\yii3-1206\vendor\yiisoft\yii-debug-api\src\Middleware\DebugHeaders.php(31): class@anonymous->handle(Object(HttpSoft\Message\ServerRequest)) #13 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(100): Yiisoft\Yii\Debug\Api\Middleware\DebugHeaders->process(Object(HttpSoft\Message\ServerRequest), Object(class@anonymous)) #14 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(54): class@anonymous->handle(Object(HttpSoft\Message\ServerRequest)) #15 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareDispatcher.php(49): Yiisoft\Middleware\Dispatcher\MiddlewareStack->handle(Object(HttpSoft\Message\ServerRequest)) #16 C:\wamp64\www\yii3-1206\vendor\yiisoft\router\src\MatchingResult.php(81): Yiisoft\Middleware\Dispatcher\MiddlewareDispatcher->dispatch(Object(HttpSoft\Message\ServerRequest), Object(App\Handler\NotFoundHandler)) #17 C:\wamp64\www\yii3-1206\vendor\yiisoft\router\src\Middleware\Router.php(46): Yiisoft\Router\MatchingResult->process(Object(HttpSoft\Message\ServerRequest), Object(App\Handler\NotFoundHandler)) #18 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(100): Yiisoft\Router\Middleware\Router->process(Object(HttpSoft\Message\ServerRequest), Object(App\Handler\NotFoundHandler)) #19 C:\wamp64\www\yii3-1206\vendor\yiisoft\session\src\SessionMiddleware.php(36): class@anonymous->handle(Object(HttpSoft\Message\ServerRequest)) #20 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(100): Yiisoft\Session\SessionMiddleware->process(Object(HttpSoft\Message\ServerRequest), Object(class@anonymous)) #21 C:\wamp64\www\yii3-1206\vendor\yiisoft\error-handler\src\Middleware\ErrorCatcher.php(135): class@anonymous->handle(Object(HttpSoft\Message\ServerRequest)) #22 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(100): Yiisoft\ErrorHandler\Middleware\ErrorCatcher->process(Object(HttpSoft\Message\ServerRequest), Object(class@anonymous)) #23 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(54): class@anonymous->handle(Object(HttpSoft\Message\ServerRequest)) #24 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareDispatcher.php(49): Yiisoft\Middleware\Dispatcher\MiddlewareStack->handle(Object(HttpSoft\Message\ServerRequest)) #25 C:\wamp64\www\yii3-1206\vendor\yiisoft\yii-web\src\Application.php(60): Yiisoft\Middleware\Dispatcher\MiddlewareDispatcher->dispatch(Object(HttpSoft\Message\ServerRequest), Object(App\Handler\NotFoundHandler)) #26 C:\wamp64\www\yii3-1206\src\ApplicationRunner.php(75): Yiisoft\Yii\Web\Application->handle(Object(HttpSoft\Message\ServerRequest)) #27 C:\wamp64\www\yii3-1206\public\index.php(24): App\ApplicationRunner->run() #28 {main}
The text was updated successfully, but these errors were encountered:
Fix post form (#311)
e1f23b4
Fixed. Thank you for report!
Sorry, something went wrong.
No branches or pull requests
What steps will reproduce the problem? Add a Post
What is the expected result? Add a Post
What do you get instead? Above error
Error can be avoided by removing getRules function in the PostForm. but then there will be no validation available. ****
Additional info
Stack Trace
Error: Call to protected Yiisoft\Validator\Rule::__construct() from context 'App\Blog\Post\PostForm' in C:\wamp64\www\yii3-1206\src\Blog\Post\PostForm.php:40
Stack trace:
#0 C:\wamp64\www\yii3-1206\vendor\yiisoft\validator\src\Validator.php(36): App\Blog\Post\PostForm->getRules()
#1 C:\wamp64\www\yii3-1206\src\Blog\Post\PostController.php(58): Yiisoft\Validator\Validator->validate(Object(App\Blog\Post\PostForm))
#2 [internal function]: App\Blog\Post\PostController->add(Object(HttpSoft\Message\ServerRequest), Object(Yiisoft\Validator\Validator), Object(App\Handler\NotFoundHandler))
#3 C:\wamp64\www\yii3-1206\vendor\yiisoft\injector\src\Injector.php(66): ReflectionFunction->invokeArgs(Array)
#4 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareFactory.php(89): Yiisoft\Injector\Injector->invoke(Object(Closure), Array)
#5 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(100): class@anonymous->process(Object(HttpSoft\Message\ServerRequest), Object(App\Handler\NotFoundHandler))
#6 C:\wamp64\www\yii3-1206\vendor\yiisoft\auth\src\Middleware\Authentication.php(57): class@anonymous->handle(Object(HttpSoft\Message\ServerRequest))
#7 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(100): Yiisoft\Auth\Middleware\Authentication->process(Object(HttpSoft\Message\ServerRequest), Object(class@anonymous))
#8 C:\wamp64\www\yii3-1206\vendor\yiisoft\data-response\src\Middleware\FormatDataResponse.php(25): class@anonymous->handle(Object(HttpSoft\Message\ServerRequest))
#9 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(100): Yiisoft\DataResponse\Middleware\FormatDataResponse->process(Object(HttpSoft\Message\ServerRequest), Object(class@anonymous))
#10 C:\wamp64\www\yii3-1206\vendor\yiisoft\csrf\src\CsrfMiddleware.php(50): class@anonymous->handle(Object(HttpSoft\Message\ServerRequest))
#11 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(100): Yiisoft\Csrf\CsrfMiddleware->process(Object(HttpSoft\Message\ServerRequest), Object(class@anonymous))
#12 C:\wamp64\www\yii3-1206\vendor\yiisoft\yii-debug-api\src\Middleware\DebugHeaders.php(31): class@anonymous->handle(Object(HttpSoft\Message\ServerRequest))
#13 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(100): Yiisoft\Yii\Debug\Api\Middleware\DebugHeaders->process(Object(HttpSoft\Message\ServerRequest), Object(class@anonymous))
#14 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(54): class@anonymous->handle(Object(HttpSoft\Message\ServerRequest))
#15 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareDispatcher.php(49): Yiisoft\Middleware\Dispatcher\MiddlewareStack->handle(Object(HttpSoft\Message\ServerRequest))
#16 C:\wamp64\www\yii3-1206\vendor\yiisoft\router\src\MatchingResult.php(81): Yiisoft\Middleware\Dispatcher\MiddlewareDispatcher->dispatch(Object(HttpSoft\Message\ServerRequest), Object(App\Handler\NotFoundHandler))
#17 C:\wamp64\www\yii3-1206\vendor\yiisoft\router\src\Middleware\Router.php(46): Yiisoft\Router\MatchingResult->process(Object(HttpSoft\Message\ServerRequest), Object(App\Handler\NotFoundHandler))
#18 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(100): Yiisoft\Router\Middleware\Router->process(Object(HttpSoft\Message\ServerRequest), Object(App\Handler\NotFoundHandler))
#19 C:\wamp64\www\yii3-1206\vendor\yiisoft\session\src\SessionMiddleware.php(36): class@anonymous->handle(Object(HttpSoft\Message\ServerRequest))
#20 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(100): Yiisoft\Session\SessionMiddleware->process(Object(HttpSoft\Message\ServerRequest), Object(class@anonymous))
#21 C:\wamp64\www\yii3-1206\vendor\yiisoft\error-handler\src\Middleware\ErrorCatcher.php(135): class@anonymous->handle(Object(HttpSoft\Message\ServerRequest))
#22 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(100): Yiisoft\ErrorHandler\Middleware\ErrorCatcher->process(Object(HttpSoft\Message\ServerRequest), Object(class@anonymous))
#23 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareStack.php(54): class@anonymous->handle(Object(HttpSoft\Message\ServerRequest))
#24 C:\wamp64\www\yii3-1206\vendor\yiisoft\middleware-dispatcher\src\MiddlewareDispatcher.php(49): Yiisoft\Middleware\Dispatcher\MiddlewareStack->handle(Object(HttpSoft\Message\ServerRequest))
#25 C:\wamp64\www\yii3-1206\vendor\yiisoft\yii-web\src\Application.php(60): Yiisoft\Middleware\Dispatcher\MiddlewareDispatcher->dispatch(Object(HttpSoft\Message\ServerRequest), Object(App\Handler\NotFoundHandler))
#26 C:\wamp64\www\yii3-1206\src\ApplicationRunner.php(75): Yiisoft\Yii\Web\Application->handle(Object(HttpSoft\Message\ServerRequest))
#27 C:\wamp64\www\yii3-1206\public\index.php(24): App\ApplicationRunner->run()
#28 {main}
The text was updated successfully, but these errors were encountered: