Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • Avatar of mralexweber
    mralexweber
    Participant

    @mralexweber

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

    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 mralexweber
    mralexweber
    Participant

    @mralexweber

    The solution for me was:
    # install bbPress plugin (via BP settings, but I don’t think it matters)
    # rename ‘Forums’ page slug I had created to forums-home (so as not to have conflict within bbP config)
    # disable ‘Forums’ in BP ? Components

    Now the forums work! However, they don’t seem to integrate with the sitewide activity stream… but that’s another topic…

    Avatar of mralexweber
    mralexweber
    Participant

    @mralexweber

    Yay, my first bug! I’m so proud. Luckily I should be able to batch-update al the user_nicename and user_url that have -2 in them…

    Avatar of mralexweber
    mralexweber
    Participant

    @mralexweber

    Okay! Did some troubleshooting as you suggested, Boone, and here’s what I’ve found that seems relevant:
    By default on my install, BP_ENABLE_USERNAME_COMPATIBILITY_MODE was “true”. I’m not sure why. When I explicitly defined it to “false”, MY user profile page worked:
    mysite.com/members/alex-weber/ — and /members/alex-weber-2-2/ did not (more on that in a second)
    also, mysite.com/members/ragnar/ (previously working) does NOT work with compatibility mode = false.

    here’s the relevant fields from the db, maybe this will shed more light…
    `mysql> select user_login, user_nicename, user_url from wp_users where user_nicename like “ragnar%”;
    +


    +


    +


    +
    | user_login | user_nicename | user_url |
    +


    +


    +


    +
    | ragnar | ragnar-2 | http://mysite.com/members/ragnar-2/ |
    +


    +


    +


    +
    1 row in set (0.00 sec)

    mysql> select user_login, user_nicename, user_url from wp_users where user_nicename like “alex-%”;

    +


    +


    +


    +
    | user_login | user_nicename | user_url |
    +


    +


    +


    +
    | Alex Weber | alex-weber | http://mysite.com/members/alex-weber-2-2/ |
    +


    +


    +


    +
    1 row in set (0.00 sec)`

    NB: I manually edited the user_nicename with SQL for Alex Weber to remove the -2-2.

    Avatar of mralexweber
    mralexweber
    Participant

    @mralexweber

    Thanks for the info again, Boone!

    The ticket you linked does seem somewhat similar — my user login was registered /before/ we installed BP, and has spaces in the login. It’s entirely likely that I changed my pw or something (using wp-admin) and that appended the -2s to my username. So with that said, let’s ignore the -2 issue as that seems to be in the past and I can easily URL-rewrite around it.

    As per the experiment you suggested: I commented out that line, and cleared W3 cache. accessing http://mysite.com/members/alex-weber/anything still doesn’t work.

    Thank you again. I really can’t say it enough!

    Avatar of mralexweber
    mralexweber
    Participant

    @mralexweber

    Digging a bit more, I found a discrepancy on my test site’s activity page between the link on my avatar and that of the activity meta. The latter seems to reference `user_url` according to the WP Cache Inspect plugin — and we’re using W3TC for caching on both production and dev sites. Before you ask, yes, I frequently clear the cache — just about every time I make another change.

    avatar link (`bp_activity_user_link()`): http://mysite.com/members/alex-weber/
    activity-meta link (`bp_activiy_action()`): http://mysite.com/members/alex-weber-2-2/ — which is what it used to be, before I modified the record in the db.

    NB: neither of these links work to access my profile. I’m not even sure if this is relevant, tbh, but it’s all I have to go on right now.

    Avatar of mralexweber
    mralexweber
    Participant

    @mralexweber

    Thanks for the reply!
    No such luck, Boone. I tried adding that to my custom-functions.php and didn’t see any change.

    Also, I’ve noticed it’s not just my handle causing problems. There was some bug previously that caused some usernames to be appended with ‘-2′ … e.g. /members/ragnar-2/ … Now, when I try to access that user’s page, I get the same (404) error, and similarly must remove the ‘-2′ (/members/ragnar/) to access their profile.

    I appreciate any leads the community has to offer to help me track down the source of this!

    Avatar of mralexweber
    mralexweber
    Participant

    @mralexweber

    @nyroka, it seems like you have a separate issue, you should probably make a new topic with a full description of your problem.

    @shadowfox12, I was looking into this a bit myself, here’s what I found:
    1. In our theme, posting to the activity stream starts with an AJAX call. the HTTP POST field is set, with ACTION=post_update
    2. the AJAX call is handled by wp-content/plugins/buddypress/bp-themes/bp-default/_inc/ajax.php (line 112) in the function bp_dtheme_post_update()
    3. this function calls the bp_activity_post_update() function, which lives in wp-content/plugins/buddypress/bp-activity.php (line 374)
    4. bp_activity_post_update() calls bp_activity_add() (same file, line 628) which creates a new object of type BP_Activity_Activity and runs its save() method.
    5. the BP_Activity_Activity class is defined in wp-content/plugins/buddypress/bp-activity/bp-activity-classes.php, and the save() method does the database update/insert.

    I’m half documenting this for myself, and half hoping that it helps you. Best of luck!

    Avatar of mralexweber
    mralexweber
    Participant

    @mralexweber

    Try disabling your plugins and see if that fixes it. Also make sure to search the forums for more ideas about troubleshooting javascript problems (here and wordpress.org)

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