Custom Fields
Re-Envisioned
Support Meta Box Geolocation Autocomplete issue with 'id' and binding

  • Creator
    Topic
  • #4114
    Sinusite
    Participant

    Hi,
    See : https://metabox.io/support/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 ?...

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #4122
    Tan Nguyen
    Participant

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

    #4146
    Tan 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
    Sinusite
    Participant

    Done. Thank You !

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