Skip to content
This repository was archived by the owner on Oct 24, 2022. It is now read-only.
This repository was archived by the owner on Oct 24, 2022. It is now read-only.

using proxy method #4

@arwystli

Description

@arwystli

Hi, I am Bob Hutchinson and I have integrated what3words with a project of mine, https://www.drupal.org/project/getlocations
I am trying to add the jquery autosuggest plugin to the getlocations project and have succeeded (but not yet committed) in getting it to work OK but when I try to add the proxy method (which I already use for the regular lookups) it fails to validate. If I disable validation it works but when I enable it the message "Please enter a valid 3 word address." switches off when an item is selected but then immediately switches back on again, even though the w3w string is valid and has been entered into the form input box.
I have fetched and installed typeahead and validate separately, the problem also occurs with the bundled version.
Looking at jquery.w3w-autosuggest-plugin.js and using console.log I can see that the variable lastValidatedSuccess remains false so isSuccess also remains false thus triggering the error message. I tried setting isSuccess to true in the if conditional at line 422 but that failed and as I am not sure what lastValidatedSuccess is for I decided it was time to contact the author.
Just to reiterate, the proxy method itself works, fetches data and returns it as json to the browser where it is displayed immediately below the input box and selecting one puts it into the input box and when I appy that to the map it goes to the right place on the map. I can disable validation but it is a nice feature and I would like to have it enabled.
There is a demo of getlocations with what3words enabled at https://test.arwystli.net/getlocations_all
This does not yet have the autosuggest applied to it but uses the proxy method to fetch the data and apply it to the map.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions