• It seems that in Events Manager 5.5.2 templates/search/search.php the default search term label is used incorrectly. The default value is not retrieved from the settings, but straight from the search terms.

    $s_default = esc_attr($args['search_term_label']);

    As a result, an empty string is used as the default value. The onfocus and onblur scripts are also set to act on.

    <input type="text" name="em_search" class="em-events-search-text em-search-text" value="" onfocus="if(this.value=='')this.value=''" onblur="if(this.value=='')this.value=''" />

    After an AJAX search with an empty search text, the default value gets written in to the field. As the onfocus and onblur scripts aren’t affected, they’re still as good as nonexistent: clicking the field doesn’t erase the default value, and emptying the field and clicking outside it doesn’t refill the default value.

    In 5.4.4’s templates/events-search.php the default was retrieved from the settings:

    $s_default = esc_attr(get_option('dbem_search_form_text_label'));

    Replacing the line in 5.5.2 with this one resolves the issue.

    http://wordpress.org/plugins/events-manager/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    I get this too, am going to let Marcus know about this.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    I think Angelo is thinking something else here… he’s pointing me to the fact that geo uses the HTML 5 placeholder attribute whereas search does not. That’ll be sorted in next update.

    I don’t get any other odd behaviour, is that the problem, or can your describe the steps or give an example where it happens?

    Thread Starter Daedalon

    (@daedalon)

    Steps to reproduce in 5.5.2:

    1. In WP-admin > EM Settings, edit the value of dbem_search_form_text_label to say “Placeholder Message”.

    2. Open a front-end page that has the event search form.

    3. The event search form should have “Placeholder Message” as its prefilled value. It doesn’t, and is empty instead.

    First post contains instructions on how to fix this by retrieving the value of $s_default from dbem_search_form_text_label instead of $args['search_term_label'].

    Thread Starter Daedalon

    (@daedalon)

    Marcus: Could this be fixed for the upcoming 5.5.3? The search form of 5.5.2 and 5.5.2.1 (dev) doesn’t show the default text properly and doesn’t behave as desired upon clicking. First post contains the fix.

    Thread Starter Daedalon

    (@daedalon)

    To recap, the fix is to change templates/templates/search/search.php line 6 from:

    $s_default = esc_attr($args['search_term_label']);

    to

    $s_default = esc_attr(get_option('dbem_search_form_text_label'));

    I’d also suggest for using $s_default as a value for the HTML 5 placeholder attribute for the input field.

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

The topic ‘templates/search/search.php uses incorrect default search term’ is closed to new replies.