Autocomplete issue with 'id' and binding

Support MB Geolocation Autocomplete issue with 'id' and binding

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4114
    SinusiteSinusite
    Participant

    Hi,
    See : https://support.metabox.io/topic/autocomplete-issue/
    I think i found the weird bug of the year...

    I have this :

    		array('id'   => "{$prefix}weirdid",'type' => 'text','std'  => '0'),		
    		
    
    		array(
                'type' => 'text',
                'name' => 'Rechercher une adresse sur la carte',
                'id'    => 'address_geo',
                'tooltip' => array( 'icon' => 'help', 'content' => 'Trouver sur la carte : position GPS, adresse postale...', 'position' => 'right' ),
            ),		           
    		array(
    			'id'            => 'geo_latlong',
    			'name'          => 'Carte',
    			'type'          => 'map',			
    			'std'           => '45.902723, 6.123793',
    			'address_field' => 'address_geo',
    			'js_options'   => array( 'scaleControl' => 'true' )			
    		),
            
            
    		array(	'id' => 'prj_115',		'type' => 'custom_html',	'std'  => '<br>'	),
    					
    		array(	'name'  => 'Adresse du projet',	'id'=> "{$prefix}adresse1",	'type' => 'text',  'binding' => 'street_number + " " + route' ),		
    
    		array(	'name'  => 'Code postal',		'id' => "{$prefix}cp",	'type' => 'number', 'binding' => 'postal_code' ),
    
    		array(
    			'name'		=>	'Commune concernée',
    			'id'		=>	"{$prefix}commune",
    			'type'		=>	'taxonomy',
    			'taxonomy'	=> 'taxo_commune',
    			'placeholder'	=>	'Choisir une commune',
    			'field_type'	=>	'select_advanced',
    			'js_options' =>array('theme' => 'classic' ),
    			'query_args'	=>	array( 'include' => $args_communes ),
    			'columns'		=>	3,			
    		),
    
            array( 'type' => 'text', 'name' => 'Geometry', 'id'    => 'geometry'),

    When i select in autocomplete adress, the "{$prefix}weirdid" is filled by someting like ad0597fb2e844f7c922914747616ad2c5d037130

    I have found to way to fix this....

    1 - add , binding => '' to {$prefix}weirdid (but why ?...)
    2 - remove 'id' at weirdid... in fact if you type any word ending by '-id'... the field is binding by the 'hash' ! (but why ???...)

    Any idea ?...

    #4122
    Tan NguyenTan Nguyen
    Participant

    Hmm, that's weird, let me check and tell you when I found the problem đŸ™‚

    #4146
    Tan NguyenTan Nguyen
    Participant

    Dear Sinusite,

    This bug cause when id is one of Google address components, and Geolocation match with any field which contains address components instead of match exactly with it. I've fixed the logic so it doesn't auto populate with any_id field. Please update to 1.1.1 which have patch for it.

    Thanks for reporting and best regards,

    Tan

    #4198
    SinusiteSinusite
    Participant

    Done. Thank You !

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Autocomplete issue with 'id' and binding’ is closed to new replies.