MESH-Research / boss-child

0 stars 3 forks source link

Migrate group type data to group meta data #117

Open ericknappe opened 2 years ago

mikethicke commented 2 years ago

@ericknappe - Where are you at on this?

For HASTAC we need a way to categorize groups, and it seems that the easiest way to do this is to use multiple group types rather than group metadata. This would keep society association as a group type, but add additional types to groups as needed. Is there a reason to move society association to group metadata rather than just adding additional group types as needed?

ericknappe commented 2 years ago

I thought ARLIS had lost interest in this and did not know it was needed for HASTAC. The initial work is not extensive, getting the theme correct, might be tricky.

Here's what I see as needed to change source of society id from group type to group meta value:

Replace bp_groups_register_group_type with a custom function

plugins/humanities-commons/society-settings.php

Replace bp_groups_get_group_type with custom function

plugins/hc-custom/includes/buddypress-group-email-subscription.php plugins/hc-custom/includes/buddypress/bp-groups.php plugins/hc-notifications/includes/class-hc-notification-join-mla-forum.php plugins/hc-member-profiles/includes/class-bp-xprofile-field-type-groups.php plugins/humanities-commons/hc-simplesaml.php plugins/humanities-commons/humanities-commons.php plugins/humanities-commons/class.mla-hcommons.php plugins/hc-styles/classes/Badges.php plugins/hc-auth/includes/class.mla-hcommons.php plugins/humcore/bwp-gxs/sitemap_humcore.php plugins/humcore/humcore-deposits.php plugins/humcore/functions.php plugins/humcore/functions.php

Modify logic to support society loops and society display

plugins/hc-custom/includes/buddypress-group-email-subscription.php plugins/hc-member-profiles/includes/class-bp-xprofile-field-type-groups.php plugins/humcore/bwp-gxs/sitemap_humcore.php plugins/humanities-commons/humanities-commons.php themes/boss-child/buddypress/groups/single/group-header.php themes/boss-child/buddypress/groups/index.php themes/boss-child-refresh/buddypress/groups/single/group-header.php themes/boss-child-refresh/buddypress/groups/index.php themes/msu-child/buddypress/groups/single/group-header.php themes/msu-child/buddypress/groups/index.php

Write data migration script

ericknappe commented 2 years ago

A new source of society ids will be needed to drive loops instead of bp group types.

This could be one of the following:

  1. COUs pulled from COmanage using the REST API and cached.
  2. The current hard coded list of COUs in the humanities-commons plugin.
  3. WP Network Meta, although there is no current UI to support that.

It would be desirable to add attributes (type and status) to the current society definitions to control loop display which would lead to selecting option 2 in the short term. See the following example attributes that would come in handy.

        $temp_cous['Cous'][] = [ 
            'Id'          => '18',
            'Name'        => 'HASTAC',
            'Status'      => 'Active',
            'Type'        => 'Open',
            'Description' => 'HASTAC'
        ];
        $temp_cous['Cous'][] = [ 
            'Id'          => '19',
            'Name'        => 'DHRI',
            'Status'      => 'Inactive',
            'Type'        => 'Closed',
            'Description' => 'Digital Humanities Research Institutes'
        ];
mikethicke commented 2 years ago

Replacing bp_groups_get_group_type with something like get_group_society in the humanities-commons repo makes sense to me.

I would prefer option 1 for getting a full list of society ids, though I see from your back-and-forth with Benn that there might be some issue there. We could have a statuc function in Humanities_Commons that returned a list of society ids. It could be hard-coded for now, and be replaced by a better option if the REST API can be made to work satisfactorily?

ericknappe commented 2 years ago

Agreed. Although the GET (and caching) of COUs from the REST API does not cause a performance issue. The reason I'm currently using option 2 is that I'm using this additional metadata - status and type - which is not available in the current Comanage to filter COUs in certain contexts.

ericknappe commented 2 years ago

A new source of society ids will be needed to drive loops instead of bp group types.

This could be one of the following:

  1. COUs pulled from COmanage using the REST API and cached.
  2. The current hard coded list of COUs in the humanities-commons plugin.
  3. WP Network Meta, although there is no current UI to support that.

It would be desirable to add attributes (type and status) to the current society definitions to control loop display which would lead to selecting option 2 in the short term. See the following example attributes that would come in handy.

        $temp_cous['Cous'][] = [ 
            'Id'          => '18',
            'Name'        => 'HASTAC',
            'Status'      => 'Active',
            'Type'        => 'Open',
            'Description' => 'HASTAC'
        ];
        $temp_cous['Cous'][] = [ 
            'Id'          => '19',
            'Name'        => 'DHRI',
            'Status'      => 'Inactive',
            'Type'        => 'Closed',
            'Description' => 'Digital Humanities Research Institutes'
        ];
ericknappe commented 2 years ago

@mikethicke I have some more debugging to do on hcdev3 and feature branches to commit for 7 repos. This feature may be ready for testing after tonight. Looks like I'll also need to merge some changes from yesterday into 2 of the branches.

mikethicke commented 2 years ago

Thanks @ericknappe --- there are other aspects of the HASTAC work that are taking longer than expected and we have a temporary solution without group types so this isn't super urgent.

bjr70 commented 1 year ago

Is this still a thing? Should this be iceboxed or closed?

bjr70 commented 1 year ago

@ericknappe is this still ongoing? Icebox or close if not?