我的表单上缺少一些验证消息,尽管它们在invalidMessages()
. 如果我输入 ATCSTudent.lastName 的姓氏,那么我不会在 ATCGradChair1 上收到 lastName 的验证消息。我尝试修复 3828 但它不起作用。
我有一个模型属于:
public $belongsTo = array(
'ATCStudent' => array('className' => 'Person', 'foreignKey' => 'studentId'),
'ATCProgram' => array('className' => 'Program', 'foreignKey' => 'programId'),
'ATCGradChair1' => array('type' => 'inner', 'className' => 'Person', 'foreignKey' => 'gradChair1Id'),
'ATCGradChair2' => array('className' => 'Person', 'foreignKey' => 'gradChair2Id'),
);
我的观点是这样的:
echo $this->Form->create('ATCForm', array('novalidate' => true));
echo $this->Form->input('id');
//echo $this->Form->input('ATCStudent.id');
echo $this->Form->input('ATCStudent.lastName');
echo $this->Form->input('ATCStudent.firstName');
echo $this->Form->input('ATCStudent.emplId');
echo $this->Form->input('ATCStudent.campusId');
echo $this->Form->input('ATCStudent.email');
echo $this->Form->input('progCode', array('type'=>'select','options'=>$programs));
echo $this->Form->input('termCode', array('type'=>'select','options'=>$terms));
echo $this->Form->input('prelimDate');
echo "<p>Enter below only cross-listed courses and/or courses taken at another institution.
";
echo $this->Form->input('cognate');
//echo $this->Form->input('ATCGradChair1.id');
echo $this->Form->inputs(array('legend'=> 'Graduate Chair 1', 'ATCGradChair1.firstName', 'ATCGradChair1.lastName', 'ATCGradChair1.campusId'));
//echo $this->Form->input('ATCGradChair2.id');
echo $this->Form->inputs(array('legend'=> 'Graduate Chair 2', 'ATCGradChair2.firstName', 'ATCGradChair2.lastName', 'ATCGradChair2.campusId'));
echo $this->Form->end('Submit');
大多数字段都是必需的。我正在使用带有深度选项的 saveAll 来保存和验证。在检查 ATCGradChair1 上的字段时,tagIsInvalid 中对 _introspectModel 的调用似乎没有返回正确的验证消息数组。
我的观点是错误的还是这是一个错误?