Skip to:
Content
Pages
Categories
Search
Top
Bottom

404 error page when trying to submit on the ‘whats-new’ form.


  • Connor
    Member

    @con101193

    I have updated to BP1.5 and running the latest wordpress, single site.

    My issue is:

    When I try to submit something on the whats new form which is on the activity pages I believe, I will get a 404 error, I have narrowed the issue down to something in my theme as the default BP theme works well.

    Please check http://www.utraz.com/activity then post (login user: test password: password)

    If you cannot do this, the link I get when clicking submit it:
    http://www.utraz.com/activity/post

    This returns a 404 error, can someone guide me in the right direction I have been working none stop for past day on this issue with no success :(

Viewing 7 replies - 1 through 7 (of 7 total)
  • That form posts by javascript. You’ve not loaded the default javascript file (global.js) in your theme. I think this is probably the problem; see that your filters on your member directory etc don’t work either.


    Connor
    Member

    @con101193

    Thank you for getting back to me :)

    What would I need to add and where to load the ‘global.js’ file, It is definitely there in my _inc file.


    Boone Gorges
    Keymaster

    @boonebgorges

    I just left a comment telling you how to do it on your wordpress.org post :)


    Connor
    Member

    @con101193

    lol tracking each other down :L

    Thank you for replying, the code didn’t show up on the post on the wordpress.org one, it says it was moderated, is there any chance you could post it here :)


    Boone Gorges
    Keymaster

    @boonebgorges

    OK, sure. You should be able to drop this in your theme’s functions.php.

    `if ( !function_exists( ‘bp_dtheme_enqueue_scripts’ ) ) :
    /**
    * Enqueue theme javascript safely
    *
    * @see https://codex.wordpress.org/Function_Reference/wp_enqueue_script
    * @since 1.5
    */
    function bp_dtheme_enqueue_scripts() {
    // Bump this when changes are made to bust cache
    $version = ‘20110921’;

    // Enqueue the global JS – Ajax will not work without it
    wp_enqueue_script( ‘dtheme-ajax-js’, WP_PLUGINS_DIR . ‘/buddypress/bp-themes/bp-default/_inc/global.js’, array( ‘jquery’ ), $version );

    // Add words that we need to use in JS to the end of the page so they can be translated and still used.
    $params = array(
    ‘my_favs’ => __( ‘My Favorites’, ‘buddypress’ ),
    ‘accepted’ => __( ‘Accepted’, ‘buddypress’ ),
    ‘rejected’ => __( ‘Rejected’, ‘buddypress’ ),
    ‘show_all_comments’ => __( ‘Show all comments for this thread’, ‘buddypress’ ),
    ‘show_all’ => __( ‘Show all’, ‘buddypress’ ),
    ‘comments’ => __( ‘comments’, ‘buddypress’ ),
    ‘close’ => __( ‘Close’, ‘buddypress’ ),
    ‘view’ => __( ‘View’, ‘buddypress’ )
    );

    wp_localize_script( ‘dtheme-ajax-js’, ‘BP_DTheme’, $params );
    }
    add_action( ‘wp_enqueue_scripts’, ‘bp_dtheme_enqueue_scripts’ );
    endif;
    `


    Connor
    Member

    @con101193

    Hi it does not appear to have worked, I put it in the child theme currently in use and the main theme. Below is my functions.php with the code in it, does that seem correct?

    <?php
    add_action( ‘widgets_init’, ‘bptc_login_out_widget’ );

    function bptc_login_out_widget() {
    register_widget( ‘BP_Theme_Converts_LogIn_Box’ );
    }
    class BP_Theme_Converts_LogIn_Box extends WP_Widget {

    /**
    * Widget setup.
    */
    function BP_Theme_Converts_LogIn_Box() {
    /* Widget settings. */
    $widget_ops = array( ‘classname’ => ‘bptc-login-out’, ‘description’ => __(‘BuddyPress Log In/Out Widget.’, ‘bptc-login-out’) );

    /* Widget control settings. */
    $control_ops = array( ‘width’ => 300, ‘height’ => 350, ‘id_base’ => ‘bptc-login-out-widget’ );

    /* Create the widget. */
    $this->WP_Widget( ‘bptc-login-out-widget’, __(‘BuddyPress Log in/out widget’, ‘bptc-login-out’), $widget_ops, $control_ops );
    }

    /**
    * How to display the widget on the screen.
    */
    function widget( $args, $instance ) {
    extract( $args );

    /* Before widget (defined by themes). */
    echo $before_widget;

    buddyPressLoginBox();

    /* After widget (defined by themes). */
    echo $after_widget;
    }

    }
    function buddyPressLoginBox() {
    ?>

    <?php printf( __( ' You can also create an account.’, ‘buddypress’ ), site_url( BP_REGISTER_SLUG . ‘/’ ) ) ?>

    <form name="login-form" id="sidebar-login-form" class="standard-form" action="” method=”post”>

    <input type="text" name="log" id="sidebar-user-login" class="input" value="” />

    <input type="submit" name="wp-submit" id="sidebar-wp-submit" value="” tabindex=”100″ />

    <?php /* Show forum tags on the forums directory */
    if ( BP_FORUMS_SLUG == bp_current_component() && bp_is_directory() ) : ?>

    <?php
    }
    if ( !function_exists( ‘bp_dtheme_enqueue_scripts’ ) ) :
    /**
    * Enqueue theme javascript safely
    *
    * @see https://codex.wordpress.org/Function_Reference/wp_enqueue_script
    * @since 1.5
    */
    function bp_dtheme_enqueue_scripts() {
    // Bump this when changes are made to bust cache
    $version = ‘20110921’;

    // Enqueue the global JS – Ajax will not work without it
    wp_enqueue_script( ‘dtheme-ajax-js’, WP_PLUGINS_DIR . ‘/buddypress/bp-themes/bp-default/_inc/global.js’, array( ‘jquery’ ), $version );

    // Add words that we need to use in JS to the end of the page so they can be translated and still used.
    $params = array(
    ‘my_favs’ => __( ‘My Favorites’, ‘buddypress’ ),
    ‘accepted’ => __( ‘Accepted’, ‘buddypress’ ),
    ‘rejected’ => __( ‘Rejected’, ‘buddypress’ ),
    ‘show_all_comments’ => __( ‘Show all comments for this thread’, ‘buddypress’ ),
    ‘show_all’ => __( ‘Show all’, ‘buddypress’ ),
    ‘comments’ => __( ‘comments’, ‘buddypress’ ),
    ‘close’ => __( ‘Close’, ‘buddypress’ ),
    ‘view’ => __( ‘View’, ‘buddypress’ )
    );

    wp_localize_script( ‘dtheme-ajax-js’, ‘BP_DTheme’, $params );
    }
    add_action( ‘wp_enqueue_scripts’, ‘bp_dtheme_enqueue_scripts’ );
    endif;
    ?>

    Hello , i followed the post and did exactly as Connor did.
    Boone Gorges, The code does not work.

    i have the same problem on my activity page.
    Reply to comment when clicked “Post” redirect to 404 page.

    but reply on other pages works fine except activity stream page.

    i get a rediret
    http://mysite.com/activity/reply

    which does not exist.

    if i redit my bp-theme-template.php. , change the ‘/reply/’ to post.
    i still get 404 from http://mysite.com/activity/post

    have done a lot of research on the Activity stream reply error. and Nothing.
    Ajax working fine too. What is going wrong. ? or what am i not doing right?

    Can anyone Help.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘404 error page when trying to submit on the ‘whats-new’ form.’ is closed to new replies.
Skip to toolbar