Skip to:
Content
Pages
Categories
Search
Top
Bottom

in Activation link the variable “key” is missing

Viewing 14 replies - 1 through 14 (of 14 total)

  • r-a-y
    Keymaster

    @r-a-y

    Are you using any plugins that might be causing a conflict with the registration and activation process?


    pauapau
    Participant

    @pauapau

    i deactivated all plugins. but the issue is still there.

    do you know path to the activation function? then i can fix it by my own.

    or do you have other ideas?


    r-a-y
    Keymaster

    @r-a-y

    congratulations! you’r a member

    This message doesn’t exist in BuddyPress. Are you using any custom code snippets in wp-content/mu-plugins or wp-content/plugins/bp-custom.php?


    pauapau
    Participant

    @pauapau

    yes i know. and actually there is not this massage. “congratulations! you’r a member”
    i just wrote it to understand my problem.

    here are two screen shots to see what is wrong.

    this doesn’t work:
    without key parameter in url
    without key parameter in url

    this one works:
    with key parameter in url

    the result with the key parameter in url:
    activation


    pauapau
    Participant

    @pauapau

    all images again. i don’t why the forum doesn’t load the images. so i post the raw link.

    without key parameter:
    https://ibb.co/cHuSWo

    with key parameter:
    https://ibb.co/e3vZBo

    activation:
    https://ibb.co/k0thxT


    pauapau
    Participant

    @pauapau

    push.

    has somebody an idea? what is wrong? and why?

    i could edit the core activation function.
    so which file and class/function will activate the user?


    r-a-y
    Keymaster

    @r-a-y

    The code to activate a user can be found here:
    https://buddypress.trac.wordpress.org/browser/tags/3.1.0/src/bp-members/screens/activate.php?marks=98#L62
    https://buddypress.trac.wordpress.org/browser/tags/3.1.0/src/bp-members/bp-members-functions.php#L1798

    It would be great if you are able to set up a fresh install of WordPress and BuddyPress to see if your activation problems are because of some custom code on your site.


    pauapau
    Participant

    @pauapau

    Thank you for you help guys!

    i installed wordpress and buddypress new. There is still the same issue.
    any idea?


    pauapau
    Participant

    @pauapau

    i found the reason

    in https://buddypress.trac.wordpress.org/browser/tags/3.1.0/src/bp-members/screens/activate.php?marks=98#L62
    at:line 101

    i found the reason. php thinks $user->errors is not empty. but it is.

    so $user->errors is empty. as my error_log says
    [17-Jul-2018 16:51:26 UTC] error activte :

    cheers pauapau


    pauapau
    Participant

    @pauapau

    sorry forgot to post the code.
    https://pastebin.com/WhAjYBfS


    pauapau
    Participant

    @pauapau

    update:
    hmm i dont know. but it seems like the $user->errors is empty with var_Dump. but with print_r not.

    also in the backend the user is activated when he clicks on the activation link. but $user->errors will give an error.

    error_Log:
    [17-Jul-2018 17:27:38 UTC] PHP Notice: Trying to get property of non-object in /mnt/web313/d2/98/57260698/htdocs/goUnhooked/wp-content/plugins/buddypress/bp-members/screens/activate.php on line 118
    [17-Jul-2018 17:27:38 UTC] error varDump:||
    [17-Jul-2018 17:27:38 UTC] error print_r:|1|

    
     error_log(" error varDump:|".var_dump($user->errors)."|");
     error_log(" error print:|".print_r($user->errors)."|");
    

    r-a-y
    Keymaster

    @r-a-y

    i found the reason. php thinks $user->errors is not empty. but it is.

    For your error log, you should use var_export( $user, true ) instead of var_dump( $user ).


    pauapau
    Participant

    @pauapau

    thank you r-a-y:)

    buddpress adds the invailid-key error at bp-members-function.php:1856
    so why it is “wrong”(if ! $wpdb->query…) that $wpdb->query can update the value?
    i dont undestand it 🙁

    // Change the user's status so they become active.
    			if ( ! $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_status = 0 WHERE ID = %d", $user_id ) ) ) {
    				return new WP_Error( 'invalid_key', __( 'Invalid activation key.', 'buddypress' ) );
    			}

    pauapau
    Participant

    @pauapau

    or maybee not.

    it is not a good idea watch into the code when you drunk to much beer 😀

    so ignore the post before.

    tomorrow will be a better day to program :D:D

Viewing 14 replies - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.
Skip to toolbar