Geolocation Autocomplete Not Working after Update

Support MB Geolocation Geolocation Autocomplete Not Working after Update

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #37422
    Johannes GrossJohannes Gross
    Participant

    I updated Metabox Geolocation from version 1.3.1 to 1.3.3 and the address autocomplete stopped working in the backend. Looks like the Google Maps library is not even being loaded. Rolling back to 1.3.1 fixed it again.

    Here is my code:

    
    function add_proposal_fields($meta_boxes) {
    		$twt_settings = get_option('twt_proposal_builder_settings');
    		global $wpdb;
    		$meta_boxes[] = array(
    			'id'           => 'customer_details',
    			'title'        => 'Customer Details',
    			'post_types'   => 'twt_proposal',
    			'context'      => 'normal',
    			'priority'     => 'high',
    			'storage_type' => 'custom_table',
    			'table'        => $wpdb->prefix . 'twt_proposals',
    			'geo' => array(
    				'api_key' => $twt_settings['google_maps_api_key'] ?? ''
    			),
    			'fields'       => array(
    				array(
    					'name' => 'Submitted To',
    					'id'   => 'submitted_to',
    					'type' => 'text',
    					'std'  => sanitize_text_field(wp_unslash($_GET['name'] ?? '')),
    				),
    				array(
    					'name' => 'Customer Information',
    					'type' => 'heading'
    				),
    				array(
    					'name'       => 'Street',
    					'id'         => 'address_c',
    					'type'       => 'text',
    					'attributes' => array(
    						'autocomplete' => 'new-password'
    					),
    					'binding' => 'street_number + " " + short:route',
    					'address_field' => 'address_c',
    					'std'  => sanitize_text_field(wp_unslash($_GET['street'] ?? '')),
    				),
    				array(
    					'name' => 'Street 2',
    					'id'   => 'street_2_c',
    					'type' => 'text',
    				),
    				array(
    					'name' => 'City',
    					'id'   => 'city_c',
    					'type' => 'text',
    					'binding' => 'locality',
    					'address_field' => 'address_c',
    				),
    				array(
    					'name'    => 'State',
    					'id'      => 'state_c',
    					'type'    => 'text',
    					'binding' => 'short:administrative_area_level_1',
    					'address_field' => 'address_c',
    				),
    				array(
    					'name' => 'Zip Code',
    					'id'   => 'zip_c',
    					'type' => 'text',
    					'binding' => 'postal_code',
    					'address_field' => 'address_c',
    					'std'  => sanitize_text_field(wp_unslash($_GET['zip'] ?? '')),
    				),
    				array(
    					'name' => 'Phone',
    					'id'   => 'phone',
    					'type' => 'tel',
    					'std'  => sanitize_text_field(wp_unslash($_GET['phone'] ?? '')),
    				),
    				array(
    					'name' => 'Email',
    					'id'   => 'email',
    					'type' => 'email',
    					'std'  => sanitize_email(wp_unslash($_GET['email'] ?? '')),
    				),
    				array(
    					'name' => 'Job Address',
    					'type' => 'heading',
    					'after' => '<button type="button" id="copy-client-address-to-job-address" class="button">Copy Address From Customer Information</button>'
    				),
    				array(
    					'name' => 'Owner Name',
    					'id'   => 'owner_name_j',
    					'type' => 'text',
    					'desc' => 'Primarily used for contractors',
    				),
    				array(
    					'name' => 'Owner Phone',
    					'id'   => 'owner_phone',
    					'type' => 'tel',
    					'desc' => 'if different, e.g. in case of a contractor'
    				),
    				array(
    					'name' => 'Owner Email',
    					'id'   => 'owner_email',
    					'type' => 'email',
    					'desc' => 'if different, e.g. in case of a contractor'
    				),
    				array(
    					'name'       => 'Street',
    					'id'         => 'address_j',
    					'type'       => 'text',
    					'attributes' => array(
    						'autocomplete' => 'off'
    					),
    					'binding' => 'street_number + " " + short:route',
    					'address_field' => 'address_j',
    				),
    				array(
    					'name' => 'Street 2',
    					'id'   => 'street_2_j',
    					'type' => 'text',
    				),
    				array(
    					'name' => 'City',
    					'id'   => 'city_j',
    					'type' => 'text',
    					'binding' => 'locality',
    					'address_field' => 'address_j',
    				),
    				array(
    					'name'    => 'State',
    					'id'      => 'state_j',
    					'type'    => 'text',
    					'binding' => 'short:administrative_area_level_1',
    					'address_field' => 'address_j',
    				),
    				array(
    					'name' => 'Zip Code',
    					'id'   => 'zip_j',
    					'type' => 'text',
    					'binding' => 'postal_code',
    					'address_field' => 'address_j',
    				),
    				array(
    					'name' => 'Job Number',
    					'id'   => 'job_number_j',
    					'type' => 'text',
    					'desc' => 'Primarily used for contractors',
    				),
    				array(
    					'name' => 'Community',
    					'id'   => 'community_j',
    					'type' => 'text'
    				),
    			)
    		);
    		return $meta_boxes;
    	}
    
    #37432
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Thanks for your feedback.

    This issue has been fixed in a new commit and it will be included in the next update of the plugin. For now, you can use the older version or add a map field to make it works.

    #39670
    SIWSIW
    Participant

    Is there any ETA when this new version will be released?

    #39692
    PeterPeter
    Moderator

    Hello SIW,

    The fix for this issue is already included in the latest version of MB Geolocation 1.3.4 or Meta Box AIO 1.16.7. Let me know if the issue still happens on your site.

    #39730
    SIWSIW
    Participant

    Hi Peter,

    Yes, it has been fixed. The fact that is was still not working was because the script handle 'google-maps' was overwritten by another plugin but without loading the places library.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.