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

Issue/2076 user registration add on allow user activation on the view #2180

Conversation

omarkasem
Copy link
Collaborator

@omarkasem omarkasem commented Oct 25, 2024

💾 Build file (a0e9441).

@omarkasem omarkasem linked an issue Oct 25, 2024 that may be closed by this pull request
3 tasks
@omarkasem omarkasem self-assigned this Oct 25, 2024
@omarkasem omarkasem requested a review from mrcasual October 25, 2024 21:01
@mrcasual mrcasual assigned Mwalek and unassigned omarkasem Oct 30, 2024
@mrcasual
Copy link
Collaborator

@Mwalek, please test.

@Mwalek
Copy link

Mwalek commented Oct 31, 2024

@mrcasual I found a few issues:

  1. There is the following warning in the front end if you create a View and attach a form that is not a user registration form or don't create a user registration feed.Warning: Undefined array key "is_active" in /.../wp-content/plugins/gravityview/includes/fields/class-gravityview-field-user-activation.php on line 149
  2. There is a fatal error if the View is visited after deactivating the User Registration add on: Fatal error: Uncaught Error: Call to undefined function gf_user_registration() in /.../wp-content/plugins/gravityview/templates/fields/field-user_activation.php:15
  3. The activate button does not appear in the multiple entries listing if the user is not activated and the user activation field is added to both multiple entries and single entry tab.
Screenshot 2024-10-31 at 6 01 01 PM

Summary

  • Warning on non-registration forms: Undefined array key "is_active".
  • Fatal error if User Registration add-on is deactivated.
  • Activate button missing for unactivated users in multiple/single entry tabs.

@mrcasual mrcasual assigned omarkasem and unassigned Mwalek Oct 31, 2024
@mrcasual
Copy link
Collaborator

@omarkasem, please address the QA issues. Thank you.

@Mwalek Mwalek assigned mrcasual, Mwalek and omarkasem and unassigned omarkasem, mrcasual and Mwalek Oct 31, 2024
@omarkasem
Copy link
Collaborator Author

@Mwalek
1,2 Done
3- I can't recreate that, I tried with table, list and it's working for me and showing.

@rafaehlers rafaehlers self-requested a review November 18, 2024 16:43
@rafaehlers
Copy link
Contributor

I'll test it!

@Mwalek
Copy link

Mwalek commented Nov 22, 2024

@omarkasem I noticed that a different warning is now shown if a form without a user registration feed is attached to a View.

Warning: Undefined array key "addon_slug" in /.../public_html/wp-content/plugins/gravityview/includes/fields/class-gravityview-field-user-activation.php on line 149

To reproduce this warning, create a View, select a form without a user registration feed, add a User Activation field to the multiple entries tab, save the changes and visit the View on the front end.

Concerning cases where the user registration addon is not installed, I'd like to suggest the following message "Install/activate Gravity Forms User Registration Add-On".

I could no longer reproduce item number 3 (Activate button missing for unactivated users in multiple/single entry tabs). ✅

@omarkasem
Copy link
Collaborator Author

@Mwalek Thanks for noticing that, Both are fixed now with the latest commit

@Mwalek
Copy link

Mwalek commented Nov 25, 2024

@omarkasem works like a charm, thank you!

cc. @mrcasual

@rafaehlers
Copy link
Contributor

I don't see the point in having "Invalid activation key." for existing users that were previously activated in some way. This appears like an error, and you know, if you display something that looks like an error, the users will ask about it.

Would it be too costly (performance wise) to check every entry against existing users and in case they exist (as users) just display the same "The user is already active." message? In the case of my screenshot below, these two entries belong are associated with users created by the UR feed in the past. I'm not sure if there's a link we can establish to check that. Check if the user listed as the Entry Creator exists, perhaps?

Also, what is our text style for these messages? I don't like these messages ending with a period. Is that correct?
Before: The user is already active.
After: The user is already active

image

@omarkasem
Copy link
Collaborator Author

@rafaehlers Good point, I added a check now to see if the user already exist before the check for activation key and i also removed the dots at the end of line.

Please test and let me know what you think

@omarkasem
Copy link
Collaborator Author

@mrcasual Thanks for the notes, they are all solved now

@mrcasual mrcasual merged commit dcdf012 into develop Dec 19, 2024
1 check passed
@mrcasual mrcasual deleted the issue/2076-user-registration-add-on-allow-user-activation-on-the-view branch December 19, 2024 23:33
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.

User Registration Add-on - Allow user activation on the View
4 participants