[MokoJoomSocialLogin] feat: Replace CB integration with MokoJoomCommunity sync #7

Open
opened 2026-06-02 19:31:33 +00:00 by jmiller · 0 comments
Owner

Migrated from MokoJoomSocialLogin#9

Summary

Update plg_user_mokojoomsociallogin to sync social profile data to MokoJoomCommunity instead of Community Builder. MokoJoomSocialLogin is a required dependency of every MokoJoomCommunity deployment -- no detection checks needed.

Current State

The user plugin currently:

  • Checks isCommunityBuilderInstalled() then syncs to #__comprofiler
  • Syncs avatar, provider name, social username to CB fields
  • Pre-populates CB on new social login registrations
  • Falls back to #__user_profiles for Joomla-only installs

Required Changes

1. Replace CB sync with MokoJoomCommunity sync

Replace syncToCommunityBuilder() with syncToMokoJoomCommunity():

  • Sync avatar URL to #__mokojoomcommunity_profiles.avatar
  • Sync provider name and social username to #__mokojoomcommunity_field_values (EAV)
  • Upsert pattern: check existing field value, update or insert

2. Remove CB detection

  • Remove isCommunityBuilderInstalled() method
  • Remove all #__comprofiler references
  • Call syncToMokoJoomCommunity() directly (no conditional)

3. Log activity on social login

Call ActivityHelper::logActivity() after successful social login to log the event to the activity stream.

4. Update plugin params

Replace CB field mapping params with MokoJoomCommunity field names:

  • Remove: cb_avatar_field, cb_provider_field, cb_social_username_field
  • Add: community_sync_avatar (bool, default 1)
  • Add: community_provider_field (field name, default social_provider)
  • Add: community_username_field (field name, default social_username)

MokoJoomCommunity Side

No code changes needed. The existing schema supports external writes:

  • #__mokojoomcommunity_profiles.avatar -- VARCHAR(255) for avatar URL
  • #__mokojoomcommunity_field_values -- EAV table accepts any field/value pair
  • CommunityHelper::getProfile() -- public static, callable from any extension

Optional: Create default custom fields social_provider and social_username in the community component install script.

Acceptance Criteria

  • Social avatar syncs to #__mokojoomcommunity_profiles.avatar
  • Social provider and username sync to custom field values
  • Pre-populate on new social login registration
  • Update on subsequent social logins
  • Activity stream entry on social login
  • All CB references removed
  • Plugin params updated for MokoJoomCommunity field names
> Migrated from MokoJoomSocialLogin#9 ## Summary Update `plg_user_mokojoomsociallogin` to sync social profile data to MokoJoomCommunity instead of Community Builder. MokoJoomSocialLogin is a required dependency of every MokoJoomCommunity deployment -- no detection checks needed. ## Current State The user plugin currently: - Checks `isCommunityBuilderInstalled()` then syncs to `#__comprofiler` - Syncs avatar, provider name, social username to CB fields - Pre-populates CB on new social login registrations - Falls back to `#__user_profiles` for Joomla-only installs ## Required Changes ### 1. Replace CB sync with MokoJoomCommunity sync Replace `syncToCommunityBuilder()` with `syncToMokoJoomCommunity()`: - Sync avatar URL to `#__mokojoomcommunity_profiles.avatar` - Sync provider name and social username to `#__mokojoomcommunity_field_values` (EAV) - Upsert pattern: check existing field value, update or insert ### 2. Remove CB detection - Remove `isCommunityBuilderInstalled()` method - Remove all `#__comprofiler` references - Call `syncToMokoJoomCommunity()` directly (no conditional) ### 3. Log activity on social login Call `ActivityHelper::logActivity()` after successful social login to log the event to the activity stream. ### 4. Update plugin params Replace CB field mapping params with MokoJoomCommunity field names: - Remove: `cb_avatar_field`, `cb_provider_field`, `cb_social_username_field` - Add: `community_sync_avatar` (bool, default 1) - Add: `community_provider_field` (field name, default `social_provider`) - Add: `community_username_field` (field name, default `social_username`) ## MokoJoomCommunity Side No code changes needed. The existing schema supports external writes: - `#__mokojoomcommunity_profiles.avatar` -- VARCHAR(255) for avatar URL - `#__mokojoomcommunity_field_values` -- EAV table accepts any field/value pair - `CommunityHelper::getProfile()` -- public static, callable from any extension **Optional:** Create default custom fields `social_provider` and `social_username` in the community component install script. ## Acceptance Criteria - [ ] Social avatar syncs to `#__mokojoomcommunity_profiles.avatar` - [ ] Social provider and username sync to custom field values - [ ] Pre-populate on new social login registration - [ ] Update on subsequent social logins - [ ] Activity stream entry on social login - [ ] All CB references removed - [ ] Plugin params updated for MokoJoomCommunity field names
jmiller added the pending: testingsocial-login labels 2026-06-02 19:52:02 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoJoomCommunity#7