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

Error reporting modification #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

dcavins
Copy link

@dcavins dcavins commented Jan 28, 2013

Switched the plugin over to using $bp->signup->errors instead of $result, because the original approach was registering an error, but wasn't stopping submission of the form. Tested under BP 1.6 & 1.7.

I'm not sure this is the best way, though, so I would appreciate your thoughts.

-David

Switched the plugin over to using $bp->signup->errors instead of
$result, because the original approach was registering an error, but
wasn't stopping submission of the form.
@dcavins
Copy link
Author

dcavins commented Jan 29, 2013

Oh, this is more complicated than I thought. On a vanilla BP install, your method allows WP_Errors to do its work on duplicate usernames/e-mail addresses and highlights those fields appropriately, but doesn't seem to prevent form submission/user creation. However, the method I proposed, which does prevent form submission, breaks WP_Errors, so duplicate usernames get a generic BP error message across the top of the form, which is not helpful. (There are several plugins that use the $bp->signup->errors style, and they all appear to break WP_Errors, at least with BP 1.7.)

Sorry for the complication.

@brandondove
Copy link
Member

Could that possibly be a bug in BP 1.7?

Hook I used previously was emptying the WP_Errors array, which isn't a
good thing.
Captures the error states behind-the-scenes of user validation in
BuddyPress with two version of the honeypot plugin.
@dcavins
Copy link
Author

dcavins commented Feb 5, 2013

Hi Brandon-

I'm not really sure. 1.7's version of bp_core_validate_user_signup is pretty different than 1.6's. I did some testing to see what was actually happening with the error arrays behind the scenes, using a fresh user and a duplicate user to test error states. I've added that as a text file if you're interested in seeing the results.

Truthfully, the method you originally proposed seems perfect and mirrors the methods used in the new version of bp_core_validate_user_signup in 1.7, so I'm not sure why it's not stopping the registration process.

-David

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

Successfully merging this pull request may close these issues.

2 participants