-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
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
Unknown scenario exception #16598
Comments
because it is logical. |
it is not logical. |
You want to use scenario that is unsupported by model? |
I think that there is no need to generate an exception if the model does not support the scenario, or it should be customizable. |
Using unsupported feature does not make sense and should throw exception - it is usually unintended configuration error or simple typo. Ignoring this is not an option, it will hide errors and make debugging much harder. You can always override const SCENARIO_UPDATE = self::SCENARIO_DEFAULT; |
yii2/framework/base/Model.php
Lines 356 to 358 in 001e4c5
Why do we need such an exception?
I have model
And I have Rest Controller
If I need to disable validator on "manager_id" field in Contact model, then I have to remove $updateScenario from ContactController. It seems to me it is not convenient.
I wish to create a basic Controller class with predefined scenarios and use these scenarios in models whenever I want, but now it is impossible.
The text was updated successfully, but these errors were encountered: