Uploaded image for project: 'COmanage'
  1. COmanage
  2. CO-2515

CoIdentifierAssignment assign does not use PrimaryName

    XMLWordPrintable

Details

    Description

      The assign() method of CoIdentifierAssignment does not use the PrimaryName when using a template to generate a name-based Identifier.

      The query to find the CoPerson model includes this code

          $args = array();
          $args['conditions'][$objType.'.id'] = $objId;
          $args['contain'][] = 'Identifier';
          if($objType == 'CoPerson') {
            $args['contain'][] = 'PrimaryName';
          }
          
          $obj = $this->Co->$objType->find('first', $args);
       

      but because of the finesse of ChangelogBehavior the contain of PrimaryName does not work. If you log the $obj returned it looks like this:

       [PrimaryName] => Array
       (
           [id] => 200052
           [honorific] => 
           [given] => Scott
           [middle] => 
           [family] => Koranda
           [suffix] => 
           [type] => official
           [language] => 
           [co_person_id] => 100552
           [org_identity_id] => 
           [primary_name] => 
           [source_name_id] => 
           [created] => 2022-09-08 19:40:13
           [modified] => 2022-09-08 19:40:31
           [name_id] => 
           [revision] => 1
           [deleted] => 
           [actor_identifier] => http://cilogon.org/serverA/users/15027556
       )
       

      Note that primary_name is NOT set to true in the returned PrimaryName object.

      Attachments

        Issue Links

          Activity

            People

              benn.oshrin@at.internet2.edu Benn Oshrin (internet2.edu)
              scott.koranda@at.internet2.edu Scott Koranda (uwm.edu/illinois.edu)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: