[buddypress-trac] [BuddyPress] #3730: search value

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Fri Nov 4 00:23:07 UTC 2011


#3730: search value
--------------------------+-----------------------------
 Reporter:  Ninos Ego     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Core          |    Version:
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------------
 When you are on the forumspage/grouppage/memberpage etc. and klick on "All
 Topics", in some themes the ajax send the value of the search, too.
 So you get no results, because it sends the value "Search Forums..." of
 the search input, too.

 To fix this bug, you can use instead of the javascript the html attribute
 placeholder.
 Here's a working example of the function:
 function bp_directory_forums_search_form();
 in the bp-forums/bp-forums-template.php


 {{{
 <form action="" method="get" id="search-forums-form">
 1312                    <label><input type="text" name="s"
 id="forums_search" value="<?php echo esc_attr( $search_value ); ?>"
 onfocus="if (this.value == '<?php echo $default_search_value ?>')
 {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php
 echo $default_search_value ?>';}" /></label>
 1313                    <input type="submit" id="forums_search_submit"
 name="forums_search_submit" value="<?php _e( 'Search', 'buddypress' ); ?>"
 />
 1314            </form>
 }}}

 You can change it to:

 {{{
 <form action="" method="get" id="search-forums-form">
 1312                    <label><input type="text" name="s"
 id="forums_search" placeholder="<?php echo esc_attr( $search_value ); ?>"
 /></label>
 1313                    <input type="submit" id="forums_search_submit"
 name="forums_search_submit" value="<?php _e( 'Search', 'buddypress' ); ?>"
 />
 1314            </form>
 }}}

 The form is in this files like the same:
 bp-members/bp-members-template.php
 bp-groups/bp-groups-template.php

 Maybe there are more similar functions.

 Buddypress 1.5.1
 Wordpress 3.2.1

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3730>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list