Uploaded image for project: 'COmanage Framework Migration'
  1. COmanage Framework Migration
  2. CFM-386

transmogrify skips valid group memberships

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Blocker
    • PE Milestone 12
    • None

    Description

      In Registry 4.x if you add a CO Person to a CO Group without making the person an Owner and then delete the CO Person from the CO Group you end up with a row in the cm_co_group_memberships table where both member and owner are false/0. Here is  an example:

      MySQL [biocommons_registry_test]> select id,co_group_id,co_person_id,member,owner,created,modified,co_group_member_id,revision,deleted from cm_co_group_members where co_group_id = 20 and co_person_id = 148\G
      *************************** 1. row ***************************
                      id: 3834
             co_group_id: 20
            co_person_id: 148
                  member: 0
                   owner: 0
                 created: 2024-04-15 15:02:09
                modified: 2024-04-15 15:02:48
      co_group_member_id: NULL
                revision: 1
                 deleted: 1
      *************************** 2. row ***************************
                      id: 3835
             co_group_id: 20
            co_person_id: 148
                  member: 1
                   owner: 0
                 created: 2024-04-15 15:02:09
                modified: 2024-04-15 15:02:09
      co_group_member_id: 3834
                revision: 0
                 deleted: 0
      2 rows in set (0.001 sec)
       

      Row 3834 has both member and owner 0. Row 3835 has row 3834 as a foreign key dependency.

      Currently transmogrify contains this logic in the check_group_membership() function:

      if(!$row['member'] && !$row['owner']) {
          throw new \InvalidArgumentException('member not set on GroupMember');
      } 

      That causes row 3834 to be skipped and then row 3835 fails because of the foreign key dependency.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: