christianwach / civicrm-wp-member-sync

CiviCRM WordPress Member Sync plugin keeps a WordPress user in sync with a CiviCRM membership by granting either a role or capabilities to a WordPress user who has that membership.
https://wordpress.org/plugins/civicrm-wp-member-sync/
GNU General Public License v2.0
17 stars 10 forks source link

civi_wp_member_sync_new_username filter not called during dry run #44

Closed composerjk closed 1 year ago

composerjk commented 1 year ago

The dry run option does not call civi_wp_member_sync_new_username during its simulation. So, the dry run would show usernames set as the default in the plugin as Display Name instead of what the filter might choose.

I'll submit a 1-line change pull request that does.

A better fix would probably be to pull out the username generation so it could be called for both simulation and sync code paths.