Author Topic: Great substantive error in all versions  (Read 2525 times)

akurek

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Great substantive error in all versions
« on: January 29, 2010, 05:15:57 am »
Great substantive error in all versions of the module fengoffice address book you can not add two people with the same name and surname, even if they have different email addresses.
« Last Edit: January 29, 2010, 05:27:54 am by akurek »

akurek

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: Great substantive error in all versions
« Reply #1 on: February 01, 2010, 10:43:58 am »
Problem solved:
Fengoffice file / application / models / contacts / Contact.class.php
   function validate(&$errors) {

      // Validate username if present
   //   if(!$this->validatePresenceOf('lastname') && !$this->validatePresenceOf('firstname')) {
   //      $errors[] = lang('contact identifier required');
   //   }
   //   if (!$this->validateUniquenessOf('firstname','lastname' )) { // if
   //      $errors[] = lang('name must be unique');
   //   }

      //if email address is entered, it must be unique
      if($this->validatePresenceOf('email')) {
         $this->setEmail(trim($this->getEmail()));
         if(!$this->validateFormatOf('email', EMAIL_FORMAT)) $errors[] = lang('invalid email address');
         if(!$this->validateUniquenessOf('email')) $errors[] = lang('email address must be unique');
      }
   } // validate