Hi there,

since I did the upgrade from 1.3 rc1 to 1.3final I have problems
validating data.

Sometimes the built in validation is not processed
sometimes not all validation rules are processes
sometimes my custom rules are ignored

All worked fine the last days.
Today I did a last check before freeezing my code and now the
validation is corrupted.

Any idea if there was a change in validation functions with 1.3 final?

some code:
class BookingPosition extends AppModel {
        var $name = 'BookingPosition';
        var $displayField = 'id';
        //The Associations below have been created with all possible keys,
those that are not needed can be removed

var $validate=array
(
'AnzahlErwachsene'      =>      array('rule'=>'limitPersonen','message'=>'zu
viele Gäste'),
'AnzahlJugendliche' =>  array('rule'=>'limitPersonen','message'=>'zu
viele Gäste'),
'AnzahlKinder'          =>      array('rule'=>'limitPersonen','message'=>'zu 
viele
Gäste'),

'AnzahlErwachsene'      =>              
array('rule'=>'CheckPersonenAnzahl','message'
=> 'Keine Belegung ohne Gast'),
'AnzahlJugendliche' =>          array('rule'=>'CheckPersonenAnzahl','message'
=> 'Keine Belegung ohne Gast'),
'AnzahlKinder'          =>              
array('rule'=>'CheckPersonenAnzahl','message' =>
'Keine Belegung ohne Gast')
);


...
...
function limitPersonen()
{
        $E = $this->data['BookingPosition']['AnzahlErwachsene'];
        $J = $this->data['BookingPosition']['AnzahlJugendliche'];
        $K = $this->data['BookingPosition']['AnzahlKinder'];
                $Y1=$this->Lodging-
>find('first',array('conditions'=>array('Lodging.id'=>$this-
>data['BookingPosition']['lodging_id'])));
        $numberOfBeds   =(int)$Y1['Lodging']['Bettenanzahl'];
        debug ($numberOfBeds);
        $X = (int)$E + (int)$J + (int)$K;
return ((int)$X <= $numberOfBeds) ; //($AnzE + $AnzJ + $AnzK)<$maxAnz;
}

function CheckPersonenAnzahl(){
//min 1 Person; kein Alterscheck
                $DataOK = false;
        $AE     = (int)($this->data['BookingPosition']
['AnzahlErwachsene']);
        $AJ     = (int)($this->data['BookingPosition']
['AnzahlJugendliche']);
        $AK     = (int)($this->data['BookingPosition']['AnzahlKinder']);
                if  ( $AE+$AJ+$AK>0) $DataOK = true;
                return $DataOK ;
}



i.e. the debug in limitPersonen is not processed (debug is still
switched on!)
Thanks in advance

Michael

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to