Home Support Extensions Geolocation Uncaught TypeError: Cannot use ‘in’ operator to search for ‘length’ in…

Uncaught TypeError: Cannot use ‘in’ operator to search for ‘length’ in…

  • Author
    Posts
  • jreitter

    Hey ihor,

    I’m getting a strange error for the google maps widget on my page I can’t figure out to fix.

    “Uncaught TypeError: Cannot use ‘in’ operator to search for ‘length’ in…” and
    “jquery.min.js?ver=3.5.1:2 jQuery.Deferred exception: Cannot use ‘in’ operator to search for ‘length’ in…”

    on the page: https://beta.airsoftboerse.com/anzeigen/

    When I go to the second listing page, the error goes away and the map works: https://beta.airsoftboerse.com/anzeigen/page/2/

    I already tried disabling plugins but no success.

    Kind regards,
    Johannes

    ihor developer

    Hi,
    This may be related to another bug reported on the forum, please try to unpublish listings with quote characters in titles for a moment and check if this issue persists.

    jreitter

    Hey ihor,

    removing the quote characters helps. Any way to escape those characters?

    ihor developer

    Please try using this code snippet as a temporary fix:

    add_action(
    	'hivepress/v1/models/listing/update',
    	function( $listing_id, $listing ) {
    		if ( strpos( $listing->get_title(), '"' ) !== false ) {
    			$listing->set_title( str_replace( '"', '”', $listing->get_title() ) )->save_title();
    		}
    	},
    	10,
    	2
    );
    jreitter

    Works perfectly fine, thanks so much, ihor!

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

You must be logged in to reply to this topic.