Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply to first item in activity stream fails

  • @lph2005

    Participant

    I think this is a second request for help – sorry if it is a repeat but there doesn’t seem to be an answer.

    The first position in the activity stream has the reply button – but once it is pressed then the mouse cursor moves to the top. In the second and all other positions, pressing the reply opens up a new dialog box and allows a reply.

    Is there a script to check? Any clues where to begin to see what is wrong?

    Thank you!

    SiteURL: http://www.thechembook.com/activity or http://www.thechembook.com/start

Viewing 5 replies - 1 through 5 (of 5 total)
  • @rogercoathup

    Participant

    Are you working with your own bespoke child theme, but using the JavaScript from the default theme?

    If so, you may have removed / altered some of the markup around the first element that the JavaScript for editing requires.

    Have a look at the selectors in your JavaScript and see if you can spot anything obvious

    @lph2005

    Participant

    Thank you. I copied the default theme _inc files into the child theme and now the activity stream is posting forum topics three times :)

    Guess I’ll delete the _inc and files – to see if things return – and pick through the JavaScript from there.

    @lph2005

    Participant

    Is this the section (line 309+)? Sorry – I’ve never bothered to look at the JavaScript for BP.

    ` /* Activity comment posting */
    if ( target.attr(‘name’) == ‘ac_form_submit’ ) {
    var form = target.parent().parent();
    var form_parent = form.parent();
    var form_id = form.attr(‘id’).split(‘-‘);

    if ( ‘activity-comments’ !== form_parent.attr(‘class’) ) {
    var tmp_id = form_parent.attr(‘id’).split(‘-‘);
    var comment_id = tmp_id[1];
    } else {
    var comment_id = form_id[2];
    }

    /* Hide any error messages */
    jq( ‘form#’ + form + ‘ div.error’).hide();
    form.addClass(‘loading’);
    target.css(‘disabled’, ‘disabled’);

    jq.post( ajaxurl, {
    action: ‘new_activity_comment’,
    ‘cookie’: encodeURIComponent(document.cookie),
    ‘_wpnonce_new_activity_comment’: jq(“input#_wpnonce_new_activity_comment”).val(),
    ‘comment_id’: comment_id,
    ‘form_id’: form_id[2],
    ‘content’: jq(‘form#’ + form.attr(‘id’) + ‘ textarea’).val()
    },
    function(response)
    {
    form.removeClass(‘loading’);

    /* Check for errors and append if found. */
    if ( response[0] + response[1] == ‘-1’ ) {
    form.append( response.substr( 2, response.length ) ).hide().fadeIn( 200 );
    target.attr(“disabled”, ”);
    } else {
    form.fadeOut( 200,
    function() {
    if ( 0 == form.parent().children(‘ul’).length ) {
    if ( form.parent().attr(‘class’) == ‘activity-comments’ )
    form.parent().prepend(‘

      ‘);
      else
      form.parent().append(‘

        ‘);
        }

        form.parent().children(‘ul’).append(response).hide().fadeIn( 200 );
        form.children(‘textarea’).val(”);
        form.parent().parent().addClass(‘has-comments’);
        }
        );
        jq( ‘form#’ + form + ‘ textarea’).val(”);

        /* Increase the “Reply (X)” button count */
        jq(‘li#activity-‘ + form_id[2] + ‘ a.acomment-reply span’).html( Number( jq(‘li#activity-‘ + form_id[2] + ‘ a.acomment-reply span’).html() ) + 1 );

        /* Re-enable the submit button after 5 seconds. */
        setTimeout( function() { target.attr(“disabled”, ”); }, 5000 );
        }
        });

        return false;
        }`

        @lph2005

        Participant

        Problem solved – it was a WP version issue. I reinstalled WP 3.0 and updated to 3.01 – and this worked. The reply button in the first position now works.

        @paulhastings0

        Participant

        Glad to hear you got it worked out.

      Viewing 5 replies - 1 through 5 (of 5 total)
      • The topic ‘Reply to first item in activity stream fails’ is closed to new replies.
      Skip to toolbar