1

Topic: Editing records

I wonder if anyone can help. I have a list of records with an edit action using the map explorer iform. In the path field i have entered record/sighting which should direct to record/sighting?occurrence_id=3264052 to enable user editing of the record.

However for some reason the redirect is appending a double prefix of /mbb//mbb/ (e.g. /mbb//mbb/record/sighting?occurrence_id=3264052) which means the edit page fails.

My website is located in a subdomain so a single prefix would be correct. I'm not sure where it is getting this from let alone the duplicate.

If someone could direct me to the offending php i'm happy to make my own amendments (though if it's in the iform i don't think i'll have permission?).

Natural History & Biodiversity Data Enthusiast

2 (edited by BDeed 13-06-2016 11:08:59)

Re: Editing records

Quick note to say this error still occurs after updating both client helpers and iform module.

Natural History & Biodiversity Data Enthusiast

3

Re: Editing records

Hi

Can you just have a quick test of setting the $base_url variable in the Drupal settings.php file to see if that helps at all.

Jim Bacon.

4

Re: Editing records

Hi Jim,

Checked the setting.php and have not got  $base_url set.
Tried to amend the file and am getting permission errors. This may be the problem so i'll have a go at sorting it that way. Thanks for the direction.

Natural History & Biodiversity Data Enthusiast

5

Re: Editing records

Drupal always ensures settings.php is read-only for security so you have to temporarily give write permissions to update it.

Jim Bacon.

6

Re: Editing records

If only! Files are all 755 and FTP is still being refused.

Also tried enabling "RewriteBase /mbb"in the .htaccess. No joy. (https://www.drupal.org/node/50322)

Similar issue here: https://www.drupal.org/node/141935?no_cache=1466005946 with suggestion that update.php needs "Enforce access checking?" setting to false before FTP can be used to access settings.php

If i figure this out i'll post back (recognise it's not an Indicia issue).

Natural History & Biodiversity Data Enthusiast

7 (edited by BDeed 23-08-2016 13:38:03)

Re: Editing records

I have come back to this and set the base url ( $base_url = 'http://www.activenaturalist.org.uk/mbb';) no difference to the edit link it's still doubling up on the /mbb/ bit.

e.g. ....activenaturalist.org.uk/mbb//mbb/record/sighting?occurrence_id=3927275..

Natural History & Biodiversity Data Enthusiast

8

Re: Editing records

Hi

Just taking a look at the code in the function report_helper::get_report_grid_actions(). It does some processing which is probably causing the effect you are seeing. E.g. the following snippet.

        // Catch lazy cases where the URL does not contain the rootFolder so assumes a relative path
        if ( strcasecmp(substr($action['url'], 0, 12), '{rootfolder}') !== 0 && 
             strcasecmp(substr($action['url'], 0, 12), '{currentUrl}') !== 0 && 
             strcasecmp(substr($action['url'], 0, 4), 'http') !== 0 && 
             strcasecmp(substr($action['url'], 0, 12), '{input_form}') !== 0 ) {
          $action['url'] = '{rootFolder}'.$action['url'];
        }

Because you have supplied a relative url that will be prepended with whatever the rootFolder is thought to be. A workaround might be just to provide an absolute url or try the {currentUrl} replacement token.

Hope this helps you in the right direction,
Jim Bacon.

PS. Don't take the word lazy personally ;-)