Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate group type data to group meta data #117

Open
ericknappe opened this issue Feb 1, 2022 · 10 comments
Open

Migrate group type data to group meta data #117

ericknappe opened this issue Feb 1, 2022 · 10 comments
Assignees

Comments

@ericknappe
Copy link

No description provided.

@mikethicke
Copy link
Contributor

@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
Copy link
Author

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
Copy link
Author

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

@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
Copy link
Contributor

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
Copy link

bjr70 commented Sep 29, 2023

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

@bjr70
Copy link

bjr70 commented Oct 18, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants