{"id":1113628,"date":"2016-05-11T23:43:28","date_gmt":"2016-05-12T06:43:28","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/autocomplete-search-breaks-the-tribe-events-bar-change-view-functionality\/"},"modified":"2016-05-27T09:35:05","modified_gmt":"2016-05-27T16:35:05","slug":"autocomplete-search-breaks-the-tribe-events-bar-change-view-functionality","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/autocomplete-search-breaks-the-tribe-events-bar-change-view-functionality\/","title":{"rendered":"Autocomplete search breaks the tribe-events-bar change view functionality"},"content":{"rendered":"<p>Hi,<br \/>\nmy situation is as follows:<\/p>\n<p>We have a site where we have installed the The Events Calendar, The Events Calendar PRO, Community Events and Filter Bar -plugins. If we have set any of the filters in filter bar to type autocomplete and then try to change the view in tribe-events-bar it outputs to console the following error message: &#8220;Uncaught TypeError: Cannot read property &#8216;length&#8217; of null&#8221;. To my understanding the problem is in code in file the-events-calendar&gt;src&gt;resources&gt;js&gt;tribe-events-bar.js in row 322<br \/>\nIt is now:<br \/>\n<code>if ( $this.val().length &amp;&amp; !$this.hasClass( 'tribe-no-param' ) ) {<\/code><\/p>\n<p>I think that if you change the if-checks to something like this:<br \/>\n<code>if ( $this.val() &amp;&amp; $this.val().length &amp;&amp; !$this.hasClass( 'tribe-no-param' ) ) {<\/code><br \/>\nit would fix the problem.<\/p>\n<p>I think the problem occurs, because in Filter Bar there is select-element bind with the autocomplete input and in tribe-events-bar.js in row 318 the code picks up the both the input and select -element of form#tribe-bar-form and div#tribe_events_filters_wrapper. The select element has no value at the beginning so the $this.val() returns undefined.<\/p>\n<p>I&#8217;ll send screenshots and live-site url in a private reply.<\/p>\n<p>Thanks!<\/p>\n<p>Sauli Rajala<br \/>\nValu Digital<\/p>\n","protected":false},"template":"","class_list":["post-1113628","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Autocomplete search breaks the tribe-events-bar change view functionality -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/autocomplete-search-breaks-the-tribe-events-bar-change-view-functionality\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Autocomplete search breaks the tribe-events-bar change view functionality -\" \/>\n<meta property=\"og:description\" content=\"Hi, my situation is as follows: We have a site where we have installed the The Events Calendar, The Events Calendar PRO, Community Events and Filter Bar -plugins. If we have set any of the filters in filter bar to type autocomplete and then try to change the view in tribe-events-bar it outputs to console [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/autocomplete-search-breaks-the-tribe-events-bar-change-view-functionality\/\" \/>\n<meta property=\"article:modified_time\" content=\"2016-05-27T16:35:05+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/autocomplete-search-breaks-the-tribe-events-bar-change-view-functionality\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/autocomplete-search-breaks-the-tribe-events-bar-change-view-functionality\/\",\"name\":\"Autocomplete search breaks the tribe-events-bar change view functionality -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-05-12T06:43:28+00:00\",\"dateModified\":\"2016-05-27T16:35:05+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/autocomplete-search-breaks-the-tribe-events-bar-change-view-functionality\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/autocomplete-search-breaks-the-tribe-events-bar-change-view-functionality\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/autocomplete-search-breaks-the-tribe-events-bar-change-view-functionality\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Filter Bar\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/filter-bar\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Autocomplete search breaks the tribe-events-bar change view functionality\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Autocomplete search breaks the tribe-events-bar change view functionality -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/autocomplete-search-breaks-the-tribe-events-bar-change-view-functionality\/","og_locale":"en_US","og_type":"article","og_title":"Autocomplete search breaks the tribe-events-bar change view functionality -","og_description":"Hi, my situation is as follows: We have a site where we have installed the The Events Calendar, The Events Calendar PRO, Community Events and Filter Bar -plugins. If we have set any of the filters in filter bar to type autocomplete and then try to change the view in tribe-events-bar it outputs to console [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/autocomplete-search-breaks-the-tribe-events-bar-change-view-functionality\/","article_modified_time":"2016-05-27T16:35:05+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/autocomplete-search-breaks-the-tribe-events-bar-change-view-functionality\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/autocomplete-search-breaks-the-tribe-events-bar-change-view-functionality\/","name":"Autocomplete search breaks the tribe-events-bar change view functionality -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-05-12T06:43:28+00:00","dateModified":"2016-05-27T16:35:05+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/autocomplete-search-breaks-the-tribe-events-bar-change-view-functionality\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/autocomplete-search-breaks-the-tribe-events-bar-change-view-functionality\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/autocomplete-search-breaks-the-tribe-events-bar-change-view-functionality\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Filter Bar","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/filter-bar\/"},{"@type":"ListItem","position":5,"name":"Autocomplete search breaks the tribe-events-bar change view functionality"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1113628","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1113628\/revisions"}],"predecessor-version":[{"id":1113633,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1113628\/revisions\/1113633"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1113628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}