1 (edited by FionaCEDaR 17-07-2014 17:11:49)

Topic: Setting to only show common names in Select option

Hi,
I am trying replicate a form I have on an old site into my main site (development site) and all seems simple enough. The form is to record Red and Grey Squirrels so in the select species option I want people to just see Red Squirrel or Grey Squirrel. This works in the old form with old out of date iform code.

I have a custom species list on the warehouse with just these two species - it includes the common name and scientific name for each.

I have the form set to:

Only allow entry of one occurrence at a time
not Include both names in species controls...
Only allow selection of species using common names in user's language

No matter what I have tried it shows all four names (two common and two scientific) in the select drop down.

When I tried doing it with the UK Master list and filtering the species on the Taxon version key it showed all species names in the drop down including the Welsh names!

When I change the form to allow multiple records to be added - so the species appear in a grid - then only the common names show.

Help!

Fiona

UPDATE: I've got this working using the Tree browser control type for selecting the species and setting the species names filter to "Only allow selection of species using names which are flagged as preferred". Happily, by doing this, I've discovered how to add an image thumbnail for a species so the user can select their species using an image - makes the form pretty. The only thing I can't seem to do is make the species names below the images be the common name rather than the scientific name. Onwards...

Fiona McCrory
CEDaR Website Officer
www.nmni.com/cedar

2

Re: Setting to only show common names in Select option

Hi Fiona,

I needed exactly the same thing and your notes were very useful.

Did you figure out " The only thing I can't seem to do is make the species names below the images be the common name rather than the scientific name"... this is what I need too and all the obvious things don't seem to be working.

Thanks, Alice

3

Re: Setting to only show common names in Select option

Hi Alice,
Unfortunately I didn't. I simply couldn't find a way of doing it so I just kept the scientific names. If you do figure it out please post it up here!
Sorry not to be more help,
Fiona

Fiona McCrory
CEDaR Website Officer
www.nmni.com/cedar

4

Re: Setting to only show common names in Select option

I'm using drupal 7 and Indicia forms 7.x-1.3 (development) from github and trying to create a single record form with choice currently of only two species.

I'm getting both the Scientific and Common names (i.e. four entries) appearing in the Species selector (Single Species Selection Control Type = "Select") despite setting the Species Names Filter to be "Only allow selection of species using common names in the user's language".

(If I also tick the "Include both names in species controls and added rows" box I get "Common - Scientific" on two of the entries and "Scientific - Scientific" on the other two, which also doesn't make sense to me).

If I try the "Tree Browser" workaround as suggested my map disappears and the Species selector becomes a large empty box.

If I try the "Treeview" option the map disappears and so does the species selector, completely.

Any suggestions please as to how to only get the common names in the species "Select" control?

I'm also getting the following warnng which doesn't fill me with confidence (but is probably unrelated)...

Strict warning: Non-static method data_entry_helper::verification_panel() should not be called statically in data_entry_helper::verification_panel() (line 339 of /home/bedscape/public_html/BRMC/indicia7/sites/all/modules/drupal-7-module-iform/client_helpers/prebuilt_forms/includes/dynamic.php).

Keith

5

Re: Setting to only show common names in Select option

I don't know what just changed but the "Select" species selector is suddenly behaving as expected with only two entries showing just the common names, or "Common - Scientific" names when I tick the "both" box. (I don't think it was anything that I did as I was trying to work out how to make my form visible to the outside world at the time).

Choosing the Treeview option, or the Tree Browser option, still kills the map though and I still have the Warning.

Keith

6

Re: Setting to only show common names in Select option

Hi Keith

Sorry for delayed response - I wasn't subscribed to this thread so wasn't alerted that you had posted here.

I won't spend time trying to replicate what you describe as it sounds like you have it working as you want. A few comments come to mind though.

1. The select suddenly behaving as expected may be related to caching. Requests for data from the warehouse are cached to improve performance. This means that some changes you can make do not appear to have any effect unless you clear the cache (which you can do through the iform configuration menu). Cached values expire after an hour which could account for the unexpected change.

2. You mention problems with Tree browser and Treeview. I've never used these and I have a recollection they may have been buggy when I did have a look at them. It is a backwater of code that is unlikely to receive attention unless there is a need for it.

3. I've seen warnings like the one you have before. They have been harmless and easily fixed by changing the function declaration to be static. The fact that it has crept in there probably indicates a developer at work with lower PHP warning levels or an earlier version of PHP than you have in place so that they did not receive the warning.

Regards,
Jim Bacon.