Hi,

I keep getting this error

"Fatal error: Class 'ErrorHandler' not found in /cake/libs/object.php
on line 203"

That is all that gets printed on the screen.
Funny thing is that I am not doing any error handling yet. (aka: not
using appError)

So far I have tracked do one way to fix it but it is only a temporary
solution.

If the users model is being called I just have to remove one specific
"hasMany" relationship(in some models have to remove all of the
hasMany relationships ) and it will start working again. This is
happening in many different models. I need these relationships so if
anyone know another way to solve this problem it would be very
helpful.

*so here is my user model:*

<?php
class User extends AppModel {

  var $name = 'User';
  var $actsAs = array('Acl' => 'requester');


  var $validate = array(
    'email' => array(
      'isemail' => array(
        'rule' => 'email',
        'required' => true
      ),
      'isunique' => array(
        'on' => 'create',
        'rule' => 'isUnique'
      )

    ),
    'first_name' => array('notEmpty'),
    'last_name' => array('notEmpty'),
    'password' => array(
      'confirmPassword' => array(
        'rule' => array('confirmPassword', 'password' ),
        'on' => 'create'
      ),
      'noempty' => array(
        'rule' => 'notEmpty'
      )
    ),
    'confirmation_password' => array(
      'rule' => 'alphanumeric',
      'required' => true
    )
  );



  function beforeSave(){

    $this->data['User']['group_id'] = 6;

    return true;
  }

  function confirmPassword($data) {
    $valid = false;
    if ( $data['password'] == Security::hash(Configure::read
('Security.salt') . $this->data['User']['confirmation_password'])) {
      $valid = TRUE;
    }
    return $valid;
  }

  //The Associations below have been created with all possible keys,
those that are not needed can be removed
  var $belongsTo = array(
    'Group' => array(
      'className' => 'Group',
      'foreignKey' => 'group_id',
      'conditions' => '',
      'fields' => '',
      'order' => ''
    )
  );

  var $hasMany = array(
// if I comment out Datum all Users actions will work again and not
throw an error.
/*
    'Datum' => array(
      'className' => 'Datum',
      'foreignKey' => 'user_id'
    ),
*/
    'OtherInfo' => array(
      'className' => 'OtherInfo',
      'foreignKey' => 'user_id'
    )
  );

  var $hasAndBelongsToMany = array(
    'Address' => array(
      'className' => 'Address',
      'joinTable' => 'users_addresses',
      'foreignKey' => 'user_id',
      'associationForeignKey' => 'address_id',
      'unique' => 'true',
      'conditions' => '',
      'fields' => '',
      'order' => '',
      'limit' => '',
      'offset' => '',
      'finderQuery' => '',
      'deleteQuery' => '',
      'insertQuery' => ''
    )
  );

  function parentNode() {
    if (!$this->id && empty($this->data)) {
        return null;
    }
    $data = $this->data;
    if (empty($this->data)) {
        $data = $this->read();
    }
    if (!$data['User']['group_id']) {
        return null;
    } else {
        return array('Group' => array('id' => $data['User']
['group_id']));
    }
  }

  /**
  * After save callback
  *
  * Update the aro for the user.
  *
  * @access public
  * @return void
  */
  function afterSave($created) {
    if (!$created) {
      $parent = $this->parentNode();
      $parent = $this->node($parent);
      $node = $this->node();
      $aro = $node[0];
      $aro['Aro']['parent_id'] = $parent[0]['Aro']['id'];
      $this->Aro->save($aro);
    }
  }
}
?>

As always thanks for the help.

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to