-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
Wordpress Profile User Creation Sign On (v2) #20807
Wordpress Profile User Creation Sign On (v2) #20807
Conversation
(Standard links)
|
test this please |
test fail is unrelated - but let's get the green tick |
@davidjosephhayes Bypassing the standard WordPress account-creation process does not seem like a good idea to me. There is a discussion about this issue in the original PR. If you want that specific behaviour for your instance, why not use the Or, alternatively, perhaps you could consider implementing the suggestion for Profile Forms to have an option to enable/disable auto-login? |
@davidjosephhayes Hmm, I may have misread this PR... seems you're fixing the code that's already in Core rather than introducing code. I'm still ambivalent about this, however, as I'd rather see Profile Forms to have an option to enable/disable auto-login. |
@christianwach I would categorize this PR as strictly a bug fix. In my testing I think the option to auto logon would be fantastic. I have seen you description of the issues with CiviCRM/WP registration detailed in couple of places. Is there a related issue open on this topic somewhere? |
Is there anything I can do to help get this PR merged? |
@davidjosephhayes let me take another look and run this. While I would prefer an option (much like account creation) on a profile, the behavior you suggest adding back is present in Drupal. Therefore, I do think the change that removed this can cause unexpected outcomes. |
@christianwach I took another look and did an This PR is working as intended. Once a user is created and a form is submitted, the user is logged in. I can see many use cases - primarily allowing member benefits once a membership form is submitted and perhaps follow up forms on events. This functionality has existed for quite some time and was recently removed. I also would prefer an option in profile settings, but this will affect all CMS. I do see site owners being surprised on upgrade that a feature that worked for quite some time now fails to work. I am OK for merging, but would like your feedback. |
@kcristiano FWIW this surprised us as well. We have a bunch of sites that use the workflow "user signs up for membership with CMS user creation, and gets redirected to a customized user-dashboard page not accessible to an anonymous user". All of a sudden all of those membership forms ended in the ugly CiviCRM "Access Denied" page instead. I am actually seeing the same behavior on a Drupal 8 site. Not sure if it's related or not yet. Edit: This patch is working on production for at least one client who really needs it at this time. So it's tested from that point of view. |
@seamuslee001 Can you take a look - this looks ready to merge from my point of view |
This looks like a good enhancement, thanks @davidjosephhayes |
Merging as per review by @kcristiano |
Overview
User is not signed in automatically when submitting a profile form with user creation on Wordpress. This was previously the behavior and I believe the intended behavior.
Before
User is not log on profile submission.
After
User is logged in on profile submission.
Technical Details
No password is passed to the
wp_signon
method in theCRM_Utils_System_WordPress::createUser
method. This is required by this method to authenticate the user (I believe). The password is known at the time of form submission so it is added to the credentials array.Currently, the
wp_signon
method is return aWP_Error
object with the error messageThe password field is empty.
Comments
It looks like this change was made in the pull request #18982 by @mlutfy with an update by @christianwach at #20057. There was good discussion by @mlutfy @kcristiano @braders @christianwach. Maybe there is a configuration difference between my Wordpress install and a standard install causing this behavior?