Skip to:
Content
Pages
Categories
Search
Top
Bottom

WordPress 3.4.2 seems to break some Achievements

  • Avatar of mralexweber
    mralexweber
    Participant

    @mralexweber

    At least, this is the best conclusion I can draw…

    The custom ajax-fired achievements that Paul helped me develop are no longer functioning. Looking at the sitewide activity stream, it seems none of these achievements have been unlocked since I performed the core update, BP update, and plugin updates (about 3 weeks ago)

    Thanks in advance for any troubleshooting steps you can provide!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Avatar of Paul Gibbs
    Paul Gibbs
    Keymaster

    @djpaul

    Are other achievements still working?
    Can you share how these custom achievements were implemented?

    Avatar of mralexweber
    mralexweber
    Participant

    @mralexweber

    Other achievements, related to posting, commenting, and friend requests seem to be working.

    The achievement is fired by an ajax call, which I have confirmed is still working.

    Here is the handler function:
    `function aw_init() {
    add_action( ‘wp_ajax_aw_handle_ajax_request’, ‘aw_handle_ajax_request’ );
    }
    add_action( ‘dpa_init’, ‘aw_init’ );

    function aw_handle_ajax_request() {
    if ( empty( $_POST ) )
    return false;

    if ( empty( $_POST ) ){
    return false;
    } else { $module = (int)$_POST; }

    $member_id = (int)$_POST;

    if ( !get_userdata( $member_id ) )
    return false;

    $achievement_slug = “quizmaster-”.$module;
    dpa_force_unlock_achievement( $member_id, $achievement_slug );
    }`

    Below is the ajax call (javascript):
    `if (condition) {
    jQuery.post(“http://mysite.com/wp-load.php “, { action: “aw_handle_ajax_request”, cookie: encodeURIComponent(document.cookie), member_id: userID.toString(), module_number: module_number } );
    }`

    Thanks again!

    PS – This board’s formatting seems to be url-encoding the double-quote after the URL on that jQuery.post(). In my code it is properly-quoted.

    Avatar of Paul Gibbs
    Paul Gibbs
    Keymaster

    @djpaul

    Hi. Thanks for the paypal. First thing I see is that you’re sending the javascript to wp-load.php; we changed this in BP 1.6 to become more standard with WordPress. Change it to http://example.com/wp-admin/admin-ajax.php

    I doubt that will fix anything, but give it a go. Tomorrow evening i’ll copy/paste your code into a dev site, and check it out.

    Avatar of mralexweber
    mralexweber
    Participant

    @mralexweber

    I think that may have fixed it! I’ll email and update here if not…

    Avatar of Paul Gibbs
    Paul Gibbs
    Keymaster

    @djpaul

    Ok, let me know.

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

The forum ‘Achievements’ is closed to new topics and replies.