MB geolocation google address autocomplete not working with conditional logic

Support MB Geolocation MB geolocation google address autocomplete not working with conditional logic

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #40057
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Hello,
    The google address field autocomplete not working if there is any conditional logic. Without conditional logic, it is working well.

    #40061
    PeterPeter
    Moderator

    Hello,

    Can you please generate the PHP code and share it with me? I've tried to create a simple case to show/hide the address field but do not see any issue.

    #40064
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Apologies for the trouble; I forgot to explain that it occurred when using the group field.

    #40066
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Hi,
    I have checked and found that it is related to my site only specifically for one of the post type. It throws the following error in console log as
    Uncaught TypeError: Cannot set properties of null (setting 'value')
    at Map.populateField (geolocation.js?ver=1671820208:54:44)
    at geolocation.js?ver=1671820208:33:62
    at Array.forEach (<anonymous>)
    at Map.populateFromAddress (geolocation.js?ver=1671820208:33:39)
    at yt.<anonymous> (geolocation.js?ver=1671820208:142:10)
    at _.O (js?libraries=places&key=AIzaSyAOZtBrBJUf9tuxWU_0bWvtFwJjLFAdxsc&ver=6.1.1:111:320)
    at Hf (js?libraries=places&key=AIzaSyAOZtBrBJUf9tuxWU_0bWvtFwJjLFAdxsc&ver=6.1.1:113:320)
    at Hf (js?libraries=places&key=AIzaSyAOZtBrBJUf9tuxWU_0bWvtFwJjLFAdxsc&ver=6.1.1:113:304)
    at _.P.set (js?libraries=places&key=AIzaSyAOZtBrBJUf9tuxWU_0bWvtFwJjLFAdxsc&ver=6.1.1:281:758)
    at z$.So (js?libraries=places&key=AIzaSyAOZtBrBJUf9tuxWU_0bWvtFwJjLFAdxsc&ver=6.1.1:121:347)

    Do you have any idea what is going wrong. I could not locate the mistake. Thanks for your effort on identifying the issue and time spending on this issue.

    #40069
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Hi, without conditional logic working fine. However, the same working in another group without problem.
    Here is the text file containing the code for your reference.
    https://1drv.ms/t/s!AjLgaRuebK87hqBAOKOZpwxlmNKEFw?e=LdxuSi

    #40075
    PeterPeter
    Moderator

    Hello,

    I do not see a field with the address ID in your code as instructed in the documentation https://docs.metabox.io/extensions/meta-box-geolocation/#address-field

    Also, the geo type should be an array of values, for example:

    'types' => ['geocode'],

    Can you please check recheck this?

    #40078
    Prabakaran ShankarPrabakaran Shankar
    Participant

    Hi, I appreciate your suggestion. However, MB Builder was used to produce that code. Anyhow, I made the suggested attempts. No fruitful outcome. I've just used the MB plugin with default themeĀ in troubleshooting mode for debugging.
    Please watch the video that is provided.
    https://1drv.ms/v/s!AjLgaRuebK87hqBC_6O3CZXY_pv7xg?e=8jrp3I

    #40104
    PeterPeter
    Moderator

    Hello,

    Can you please export the field group to a JSON file? I will try to import it to my demo site and try to investigate the issue.
    Please read more on the documentation https://docs.metabox.io/extensions/meta-box-builder/#export--import

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