26

Re: Unexpected behaviour of Edit link in data entry form

Hi Alan,

I tried the sample-with-occurrences form combined with single species entry (selecting from a species list). Using Instant Indicia 0.8.2 it failed to reload the sample or occurrence correctly when I tried to edit a record. I then repeated the test using the latest version of the iForm module. This worked correctly.

We have now found various problems with Instant Indicia 0.8.2. Because there is no 0.8.2 branch of the iForm module in which to save fixes, they are simply scattered around this forum, I think maintaining it has now become untenable. I therefore ask you to update to the latest version of the iform module from the repository. We'll move forwards from there.

Jim.

27

Re: Unexpected behaviour of Edit link in data entry form

Hi Jim

I've just got around to checking out the iform module (revision 5528) and updating my Instant Indicia 0.8.2 installation with it. Unfortunately it causes a problem:

require_once(./sites/all/modules/iform/client_helpers/helper_config.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in ..../sites/all/modules/iform/iform.module on line 918

and my data entry form will not load at all (with a server error).

Alan

Alan Hale
Aberystwyth

28

Re: Unexpected behaviour of Edit link in data entry form

Hi Alan,

If you still have the old version of the iForm module that is being replaced then simply copy helper_config.php from the old client_helpers to the new. Where the client_helpers were previously installed in the sites/all/libraries/iform (and the old version will still be there if you haven't moved it), I expect the version from the repository will have them in the sites/all/modules/iform folder.

If you deleted the old version then you can copy _helper_config.php to helper_config.php in the sites/all/modules/iform/client_helpers folder.

The config file isn't in the repository since we wouldn't want to overwrite your config with ours when updating from the repository.

Jim Bacon

29 (edited by Alan Hale 28-03-2013 16:08:16)

Re: Unexpected behaviour of Edit link in data entry form

Hi Jim

I was just about to say I haven't deleted helper_config.php when I realised my mistake - in my rush I'd copied everything downloaded under "iform" to the sites/all/modules/iform folder -  including the client_helpers, which should have gone under sites/all/libraries. Having done that, all seems to be working again.

However, it's still the case that if I make an edit to a "record" the sample is amended and a new occurrence is created. Which seems a bit odd to me, although from what you say this is perhaps the way it's designed to work.

Cheers

Alan

Alan Hale
Aberystwyth

30

Re: Unexpected behaviour of Edit link in data entry form

Hi Alan,

Glad you are working again and thanks for updating. I'm very pleased that we are no longer trying to debug Instant Indicia 0.8.2.
It would certainly seem wrong to me for editing a record to create a new occurrence.
I obviously haven't recreated your configuration successfully yet in order to reproduce the problem.
So, next question... You say that this is a recording form for only one species. Have you got a species list with only one species in or have you used filters to limit the number of available species to one from a larger list?

Jim.

31

Re: Unexpected behaviour of Edit link in data entry form

Hi Jim

I'm using a species list with several species and then setting a default species in the Form Structure section of the User Interface - vis. @default=215

Cheers

Alan

Alan Hale
Aberystwyth

32

Re: Unexpected behaviour of Edit link in data entry form

Hi Alan

Okay, hadn't thought of that option. That must mean that users could actually select a different species from the list than the one you want, so this may not be how you want it to operate anyway. Read the notes under the Taxon Filter Items for an alternative to consider.

Nonetheless, in the interests of trying to recreate your problem, what Single Species Selection Control Type have you gone for?

It would be nice if there was an easy way for you to dump your configuration so there wasn't all this to and fro.

Off to track down the Easter Bunny now. Back next week.

Jim Bacon.

33

Re: Unexpected behaviour of Edit link in data entry form

Hi Jim

Sorry, I'm mistaken, there is only a single species in my list.  Otherwise, of course the other options could still be selected.

I'm using the radio button control.

Hope you have a good (long) weekend.

Cheers

Alan

Alan Hale
Aberystwyth

34

Re: Unexpected behaviour of Edit link in data entry form

Hi Alan

I've finally reproduced your problem. I was getting muddled with one of our other threads about edit links not to mention being distracted by all the other problems along the way.

What I have observed is that if you have an edit link that looks like /path/to/form?occurrence_id=6789 then the occurrence and its sample will reload, you can edit them and save, and no new occurrences will be created.

If the link looks like /path/to/form?sample_id=6789 or /path/to/form?sample_id=6789&occurrence_id={occurrence_id} then only the sample is reloaded and, if you edit and save, a new occurrence is created.

So, either the link needs to include the occurrence_id, which is not returned by the dynamic_sample_occurrences_samples report, or, on loading a sample, its occurrences should be automatically loaded.

I'm not quite sure at the moment when this went wrong or why (or if it has always been wrong) so I'm not sure where to apply a fix. Maybe John has some helpful pointers, otherwise I will have to look back through the repository for changes to this area of code and see why they were made.

Jim Bacon.

35

Re: Unexpected behaviour of Edit link in data entry form

Hi

I've also just noticed, on a site that I am working on, that the occurrence data is re-loaded correctly on a form where I have a species checklist, even though the link only includes a sample_id.

Jim Bacon.

36 (edited by Alan Hale 04-04-2013 07:46:26)

Re: Unexpected behaviour of Edit link in data entry form

Hi Jim

Thanks for all this - curioser and curioser.

Just in case, I decided to checked what happens if I use species list with multiple species and/or not setting a default species. I still get the same problem - that a new occurrence is created - either way.

Cheers

Alan

Alan Hale
Aberystwyth

37

Re: Unexpected behaviour of Edit link in data entry form

Hi Alan,

I have found the cause of this problem and submitted a fix in r5575.

Regards,
Jim Bacon.

38

Re: Unexpected behaviour of Edit link in data entry form

Many thanks Jim - I'll take a look at this tomorrow.

Cheers

Alan

Alan Hale
Aberystwyth

39

Re: Unexpected behaviour of Edit link in data entry form

Hi Jim

Yep, that now works as expected. Brilliant! Many thanks for your persistence with this.

Alan

Alan Hale
Aberystwyth