Model validate required on scenario

Hi guys,

I have an issue here with CraftCMS which is build on Yii 1. I want a certain field in my model to be required in a certain scenario. I use this rule for it:


'visionMission' =>  array(AttributeType::String, 'required', 'on' => 'step-2')

However, Yii will not accept this. For some reason this does not seem to work. I set the scenario before validating the model, but Yii doesn’t check if any data is set. It just continues. When I remove “on => step-2” it will work.

What am I doing wrong here? Can anyone tell me?