1 (edited by Ambulare 08-09-2014 11:50:47)

Topic: Species Name Containing Space

Hi all,

I'm using the Iform module with Drupal 7 and have come across a problem.

When users try to enter a species into the standard species box on a recording form, the autocomplete function works fine unless there's a space in the name, in which case the API request to the warehouse always returns no results so gives the user no options to choose from for the species.

So a person wanting to enter, say, "Common Dolphin" can enter "Common" but not narrow it down to "Common Dol", for example.

I've had a quick look at the network activity comparing my site to the iRecord site, where species with spaces are returned successfully and it looks like the species name is being URL encoded (so spaces become %20) on my site but spaces are being stripped out on iRecord - so my site passes the species name as common%20dolphin but iRecord passes commondolphin.

Is this a problem relating to the version of iForm I'm running - has the warehouse changed the format of the text string that it required for species searches?

Edit: Actually, the iForm on my site is encoding the spaces as %2520, which is causing the problem. It seems the warehouse does accept %20 as a URL encoded space, but for some reason my iForm is encoding the string twice. Anybody come across a similar problem?

2

Re: Species Name Containing Space

Hi
Just a thought - does your form have the "cache lookups" option ticked on it's edit page under the Species section? This is what gives iRecord its tolerance of spacing and punctuation in the species searches.
Best wishes
John

John van Breda
Biodiverse IT

3

Re: Species Name Containing Space

johnvanbreda wrote:

Hi
Just a thought - does your form have the "cache lookups" option ticked on it's edit page under the Species section? This is what gives iRecord its tolerance of spacing and punctuation in the species searches.
Best wishes
John

That nailed it, thanks John.

All the best,

Steve