Autocomplete issue
Support › MB Geolocation › Autocomplete issue
- This topic has 5 replies, 3 voices, and was last updated 8 years, 10 months ago by
Tan Nguyen.
-
AuthorPosts
-
May 21, 2016 at 9:25 PM #3138
Sinusite
Participantafter https://support.metabox.io/topic/auto-complete-and-map-field-conflicts/
two curious things ;
1 - uncomment include MBG_DIR . 'examples/example.php'; don't work with a new post :
mb-geo.js?ver=1.0.0:89 Uncaught TypeError: Cannot read property 'Autocomplete' of undefined2 - i have a more complex CPT with hidden text fields. When i use autocomplete, it works, but the text fields (for the same metabox) are filled by somthing like 86209711dc1123d3052690626e21a5a52e08c82e
Thanks 🙂
May 23, 2016 at 8:30 AM #3143Anh Tran
KeymasterHi @Sinusite,
@Tan Nguyen will answer you the 1st question :). Regarding the 2nd question: are you using password field? We received a request from a user asking for hashing the password and not showing plain password in a hidden field to make it secured. For more info about the hashing function, please read this documentation at the Codex.
May 30, 2016 at 12:03 AM #3203Sinusite
ParticipantNo i'm not using a password field. - may be the nonce of ajax in page ? I will check that later...
June 5, 2016 at 6:57 PM #3313Sinusite
ParticipantHi,
Found an issue, may be it is only in my context...
I put a meta-box with "geo" in two custom post types.$meta_boxes['projet'] = array( 'title' => 'Projet', 'id' => 'box_projet', 'pages' => array( 'bbv_conseil', 'bbv_projet' ), 'context' => 'normal', 'priority' => 'low', 'autosave' => false, 'geo' => array( 'types' => array('establishment','geocode'), 'componentRestrictions' => array( 'country' => 'fr' ) ),
It's working for the 1st, not the second post type ( same with geo => true ...) :
mb-geo.js?ver=1.0.0:89 Uncaught TypeError: Cannot read property 'Autocomplete' of undefined
After reading that, i added in map.php line 18
https://maps.google.com/maps/api/js<strong>?libraries=places</strong>
and it works.
It seems<script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?libraries=places&ver=4.2.2'></script>
is not included in the second post type
nota : ?sensor=false is useless
June 5, 2016 at 7:20 PM #3314Sinusite
Participantmmm... i tried with the Geoloc example instead of my cpt :
if $meta_boxes['mine'] is called with AND before $meta_boxes['with_geo'], it works....
( $meta_boxes['1'] can contain only 1 text field )i also put the demo (adress and map fields) in $meta_boxes['1'] and it seems not working if there only one metabox.
June 6, 2016 at 6:17 PM #3365Tan Nguyen
ParticipantHi Sinusite,
Perhaps in your context, the maps field's script in loaded before Geolocation. To fix that, go to
inc/class-meta-box-geolocation.php
and replace:add_action('rwmb_enqueue_scripts', array($this, 'enqueue'));
with:
add_action('admin_enqueue_scripts', array($this, 'enqueue'));
to make sure MB Geolocation loaded first.
Let me know if it works so I'll put the patch to the next release 🙂
Also, I don't understand this:
if $meta_boxes[‘mine’] is called with AND before $meta_boxes[‘with_geo’], it works….
( $meta_boxes[‘1’] can contain only 1 text field )i also put the demo (adress and map fields) in $meta_boxes[‘1’] and it seems not working if there only one metabox.
Best regards,
Tan
-
AuthorPosts
- The topic ‘Autocomplete issue’ is closed to new replies.