You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When disconnecting a donor in the admin panel if ( ! $donor->update( $donor_args ) ) does the actual update_meta to set the user_id meta_value to 0. The update will go through successfully and it will always return true. Since you check for false, it will never go into that block and instead incorrectly do the else block which is intended for failure. Wy the error that鈥檚 set doesn鈥檛 show, I don鈥檛 know. Didn鈥檛 look into that.
How I realized this is that I was wondering why in includes/admin/donors/donor-functions.php in function give_connect_user_donor_profile() you are checking and deleting metas:
Looking at the database these meta keys are never present anywhere for a user. That is because of the incorrect true/false check in give_disconnect_donor_user_id().
Honestly, I can鈥檛 even figure out why you wanted to set those 3 metas in the first place. I don鈥檛 see any other functions that would use them, so they seem redundant??
Bug Type
I am not sure whether this functionality ever worked as expected.
Steps to Reproduce
Look at the code.
Possible Solution
Though I didn't test it, I'd assume change the if statement to
if ( $donor->update( $donor_args ) ) {
or maybe rethink what those _give_disconnected_user_id, etc were supposed to be used for?
Acceptance Criteria
Improve logic for user and donor profile disconnection
Fix the new bug found while investigating the issue - Reconnect user & donor disconnection email is not sent!
Testing
Environment
Give version 2.4.7
The text was updated successfully, but these errors were encountered:
Bug Report
User Story
Sigh, user stories... 馃檮... Ok. As a developer, I want code without Bugs 馃槒
Current Behavior
This does not impact functionality.
However there is a logic bug in
includes/admin/donors/donor-actions.php
in functiongive_disconnect_donor_user_id()
line 313 of Give 2.4.7 in:When disconnecting a donor in the admin panel
if ( ! $donor->update( $donor_args ) )
does the actual update_meta to set the user_id meta_value to 0. The update will go through successfully and it will always return true. Since you check for false, it will never go into that block and instead incorrectly do the else block which is intended for failure. Wy the error that鈥檚 set doesn鈥檛 show, I don鈥檛 know. Didn鈥檛 look into that.How I realized this is that I was wondering why in
includes/admin/donors/donor-functions.php
in functiongive_connect_user_donor_profile()
you are checking and deleting metas:Looking at the database these meta keys are never present anywhere for a user. That is because of the incorrect true/false check in give_disconnect_donor_user_id().
Honestly, I can鈥檛 even figure out why you wanted to set those 3 metas in the first place. I don鈥檛 see any other functions that would use them, so they seem redundant??
Bug Type
Steps to Reproduce
Possible Solution
Though I didn't test it, I'd assume change the if statement to
if ( $donor->update( $donor_args ) ) {
or maybe rethink what those _give_disconnected_user_id, etc were supposed to be used for?
Acceptance Criteria
Environment
Give version 2.4.7
The text was updated successfully, but these errors were encountered: