Closed maurobender closed 10 years ago
I was testing your code and had issues with numerical pk=0. So I will change to
$elem_pk = $this->primaryKey;
$valid_elem_pk = !empty($elem_pk);
if($valid_elem_pk && is_array($elem_pk))
{
$valid_elem_pk = true;
foreach($elem_pk as $t_pk)
{
//allow numerical 0, boolean false as valid pk
$valid_elem_pk = $valid_elem_pk && $t_pk!=='' && !is_null($t_pk);
}
}
Does this work for you?
Related to the issue: https://github.com/yii-joblo/multimodelform/issues/9.