1

Topic: Some issues

Hi there,

I think I need your help. I installed the latest indidicia warehouse and an indicia website on Drupal 7 with features installed running local on xampp. But I keep having some issues:

I would like to have a my records page, since there is no feature for this in drupal 7 I stumbled on a topic here.

johnvanbreda wrote:

Hi Steve
For question 1, would the iRecord style My Records suit your purpose? If so, then you need to create a Dynamic Report Explorer page, and specify the following under User Interface > Form configuration:

[standard_params]
@allowSave=true
@linkToMapDiv=map
@taxon_list_id=15
@filter-my_records=1
@indexedLocationTypeIds=[15,1370]
@otherLocationTypeIds=[2412,2188]
[map]
@dataSource=library/occurrences/filterable_explore_list_mapping
@dataSourceLoRes=library/occurrences/filterable_explore_list_mapping_lores
=Records=
[report_grid]
@dataSource=library/occurrences/filterable_explore_list
@rowId=occurrence_id
@downloadLink=true
=Species=
[report_grid]
@id=species
@dataSource=library/taxa/filterable_explore_list
@downloadLink=true
@rowId=taxon_meaning_id
@linkFilterToMap=false
=Taxon groups=
[report_grid]
@id=taxon_groups
@dataSource=library/taxon_groups/filterable_explore_list
@downloadLink=true
@rowId=taxon_group_id
@linkFilterToMap=false
=Families=
<p>This report shows a breakdown of the species and record counts by taxonomic family.</p>
[report_grid]
@id=families
@dataSource=library/taxa/filterable_explore_list_taxonomy_breakdown
@downloadLink=true
@linkFilterToMap=false
=Photos=
[report_grid]
@id=photos
@dataSource=library/occurrence_images/filterable_explore_list
@rowId=occurrence_id
@includeAllColumns=false
@headers=false
@galleryColCount=4
@itemsPerPage=16

Under the report settings, preset parameters specify the following:

smpattrs=
occattrs=
default_input_form=enter-record-list
my_records=1

You'll of course need to tweak map and other settings to your liking but hopefully that will get you started.

If you need to remove a column from the first records grid for example, then under Report Settings > Columns Configuration List, click Add Columns List to Column Configuration List (this adds a container for a list of column definitions that will control behaviour of the first grid on the page). Now, add columns to this list and for each, add the fieldname property and set it to the fieldname output by the report, and add the visible checkbox property and leave it unchecked.

If you want to add your own custom attribute columns to the report, then specify the attribute IDs under the smpattrs and occattrs as a comma separated list, in the preset parameters setting as described above.

2. When you expose your records to verification in iRecord, they will only appear on the verification screens which only verifiers can see, not all users. Each verifier has a taxonomic and geographic filter as appropriate, so they will only see the records which suit their expertise.

Best wishes
John

When I enter the code like it is there and save the page I got following error and a blank report.

Notice: Undefined variable: cookieParams in report_helper::get_report_grid_current_param_values() (line 2238 of C:\xampp\htdocs\instant\sites\all\modules\iform\client_helpers\report_helper.php).
Warning: array_diff_key(): Argument #1 is not an array in report_helper::get_report_grid_current_param_values() (line 2238 of C:\xampp\htdocs\instant\sites\all\modules\iform\client_helpers\report_helper.php).
Warning: array_merge(): Argument #1 is not an array in report_helper::get_report_grid_current_param_values() (line 2242 of C:\xampp\htdocs\instant\sites\all\modules\iform\client_helpers\report_helper.php).
Warning: Invalid argument supplied for foreach() in report_helper::get_report_grid_current_param_values() (line 2255 of C:\xampp\htdocs\instant\sites\all\modules\iform\client_helpers\report_helper.php).
Notice: Undefined variable: cookieParams in report_helper::get_report_grid_current_param_values() (line 2238 of C:\xampp\htdocs\instant\sites\all\modules\iform\client_helpers\report_helper.php).
Warning: array_diff_key(): Argument #1 is not an array in report_helper::get_report_grid_current_param_values() (line 2238 of C:\xampp\htdocs\instant\sites\all\modules\iform\client_helpers\report_helper.php).
Warning: array_merge(): Argument #1 is not an array in report_helper::get_report_grid_current_param_values() (line 2242 of C:\xampp\htdocs\instant\sites\all\modules\iform\client_helpers\report_helper.php).
Warning: Invalid argument supplied for foreach() in report_helper::get_report_grid_current_param_values() (line 2255 of C:\xampp\htdocs\instant\sites\all\modules\iform\client_helpers\report_helper.php).

Also, I'm unable to upload images when entering data. I got following error:

There was an SQL error: ERROR: insert or update on table "occurrence_media" violates foreign key constraint "fk_occurrence_media_type" DETAIL: Key (media_type_id)=(0) is not present in table "termlists_terms". - INSERT INTO "occurrence_media" ("created_on", "created_by_id", "updated_on", "updated_by_id", "caption", "media_type_id", "path", "occurrence_id") VALUES ('20141104 11:13:49', 1, '20141104 11:13:49', 1, NULL, 0, 'o_195t4n89v1ek51ic7981g2p148a5.jpg', 11)

[occurrence_medium:general]
An error occurred
There was an SQL error: ERROR: current transaction is aborted, commands ignored until end of transaction block - insert into cache_occurrences ( id, record_status, release_status, downloaded_flag, zero_abundance, website_id, survey_id, sample_id, survey_title, date_start, date_end, date_type, public_entered_sref, entered_sref_system, public_geom, sample_method, taxa_taxon_list_id, preferred_taxa_taxon_list_id, taxonomic_sort_order, taxon, authority, preferred_taxon, preferred_authority, default_common_name, search_name, taxa_taxon_list_external_key, taxon_meaning_id, taxon_group_id, taxon_group, created_by_id, cache_created_on, cache_updated_on, certainty, location_name, recorders, verifier, verified_on, images, training, location_id, input_form, sensitivity_precision ) select distinct on (o.id) o.id, o.record_status, o.release_status, o.downloaded_flag, o.zero_abundance, su.website_id as website_id, su.id as survey_id, s.id as sample_id, su.title as survey_title, s.date_start, s.date_end, s.date_type, case when o.confidential=true or o.sensitivity_precision is not null then null else case when s.entered_sref_system = '4326' and coalesce(s.entered_sref, l.centroid_sref) ~ '^-?[0-9]*\.[0-9]*,[ ]*-?[0-9]*\.[0-9]*' then abs(round(((string_to_array(coalesce(s.entered_sref, l.centroid_sref), ','))[1])::numeric, 3))::varchar || case when ((string_to_array(coalesce(s.entered_sref, l.centroid_sref), ','))[1])::float>0 then 'N' else 'S' end || ', ' || abs(round(((string_to_array(coalesce(s.entered_sref, l.centroid_sref), ','))[2])::numeric, 3))::varchar || case when ((string_to_array(coalesce(s.entered_sref, l.centroid_sref), ','))[2])::float>0 then 'E' else 'W' end when s.entered_sref_system = '4326' and coalesce(s.entered_sref, l.centroid_sref) ~ '^-?[0-9]*\.[0-9]*[NS](, |[, ])*-?[0-9]*\.[0-9]*[EW]' then abs(round(((regexp_split_to_array(coalesce(s.entered_sref, l.centroid_sref), '([NS](, |[, ]))|[EW]'))[1])::numeric, 3))::varchar || case when coalesce(s.entered_sref, l.centroid_sref) like '%N%' then 'N' else 'S' end || ', ' || abs(round(((regexp_split_to_array(coalesce(s.entered_sref, l.centroid_sref), '([NS](, |[, ]))|[EW]'))[2])::numeric, 3))::varchar || case when coalesce(s.entered_sref, l.centroid_sref) like '%E%' then 'E' else 'W' end else coalesce(s.entered_sref, l.centroid_sref) end end as public_entered_sref, case when s.entered_sref_system is null then l.centroid_sref_system else s.entered_sref_system end as entered_sref_system, reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, o.sensitivity_precision, case when s.entered_sref_system is null then l.centroid_sref_system else s.entered_sref_system end) as public_geom, tmethod.term as sample_method, cttl.id as taxa_taxon_list_id, cttl.preferred_taxa_taxon_list_id, cttl.taxonomic_sort_order, cttl.taxon, cttl.authority, cttl.preferred_taxon, cttl.preferred_authority, cttl.default_common_name, cttl.search_name, cttl.external_key as taxa_taxon_list_external_key, cttl.taxon_meaning_id, cttl.taxon_group_id, cttl.taxon_group, o.created_by_id, now(), now(), case when certainty.sort_order is null then null when certainty.sort_order <100 then 'C' when certainty.sort_order <200 then 'L' else 'U' end, case when o.confidential=true or o.sensitivity_precision is not null then null else coalesce(l.name, s.location_name) end, s.recorder_names, pv.surname || ', ' || pv.first_name, o.verified_on, images.list, o.training, s.location_id, s.input_form, o.sensitivity_precision from occurrences o left join cache_occurrences co on co.id=o.id join samples s on s.id=o.sample_id left join locations l on l.id=s.location_id and l.deleted=false join surveys su on su.id=s.survey_id left join cache_termlists_terms tmethod on tmethod.id=s.sample_method_id join cache_taxa_taxon_lists cttl on cttl.id=o.taxa_taxon_list_id left join (occurrence_attribute_values oav join termlists_terms certainty on certainty.id=oav.int_value join occurrence_attributes oa on oa.id=oav.occurrence_attribute_id and oa.deleted='f' and oa.system_function='certainty' ) on oav.occurrence_id=o.id and oav.deleted='f' left join users uv on uv.id=o.verified_by_id and uv.deleted=false left join people pv on pv.id=uv.person_id and pv.deleted=false left join (select occurrence_id, array_to_string(array_agg(path), ',') as list from occurrence_media where deleted=false group by occurrence_id) as images on images.occurrence_id=o.id where co.id is null and o.id in (11)

[sample:general]

Thanks in advance
Dieter

2

Re: Some issues

And I would like to add a shape file to the indicia warehouse but I can not choose my spatial reference system, namely Belgian Lambert 72 with id 31370. Can I add the SRID myself?

3

Re: Some issues

Hi Dieter
Are you happy to grab the code from Subversion please rather than the downloads, so I can check you are up to date with code we are currently using?

For the warehouse can you update to the 0.9.1 branch please.  -
svn checkout "https://indicia.googlecode.com/svn/core/core/branches/version 0.9.1"

For the iform module on the Drupal 7 site, are you using the latest copy from subversion?

I've added the configuration for Lambert 72 to the application/config/sref_notations.php file for you.

Best wishes
John

John van Breda
Biodiverse IT

4

Re: Some issues

Hi John,

The my record page does not give the errors anymore after updating. However, still no output!

In the dynamic form to enter data, the add photo button does not open my explorer anymore. Could not test for the sql error.

And when trying to upload the shp file in warehouse I stumble on this message: Unable to Complete Request. Well it's when I already can choose the SRID and them submit I get this error. Hopefully I get this all working...

Dieter

5

Re: Some issues

Back to where I started. I get the error again with the dynamic report :(

Notice: Undefined variable: cookieParams in report_helper::get_report_grid_current_param_values() (line 2238 of C:\xampp\htdocs\instant\sites\all\modules\iform\tags\version 0.9.0\iform\client_helpers\report_helper.php).
Warning: array_diff_key(): Argument #1 is not an array in report_helper::get_report_grid_current_param_values() (line 2238 of C:\xampp\htdocs\instant\sites\all\modules\iform\tags\version 0.9.0\iform\client_helpers\report_helper.php).
Warning: array_merge(): Argument #1 is not an array in report_helper::get_report_grid_current_param_values() (line 2242 of C:\xampp\htdocs\instant\sites\all\modules\iform\tags\version 0.9.0\iform\client_helpers\report_helper.php).
Warning: Invalid argument supplied for foreach() in report_helper::get_report_grid_current_param_values() (line 2255 of C:\xampp\htdocs\instant\sites\all\modules\iform\tags\version 0.9.0\iform\client_helpers\report_helper.php).

6

Re: Some issues

I thought I start from scratch with the warehouse version 0.9.1. Bad idea, the script to update the database is not working then... I first have to install the warehouse from the download page (0.9.0.1) and then update this version with the one from the svn. Don't know, but I thought you might want to know this.

7 (edited by dieter 05-11-2014 18:59:31)

Re: Some issues

I tried to do the report in the warehouse using the warehouse user id and apparently I get an sql error.

cUrl POST request failed. Please check cUrl is installed on the server and the $base_url setting is correct.
URL:localhost/indicia/index.php/services/report/requestReport?report=library/occurrences/explore_list.xml&reportSource=local&mode=json&nonce=68130c5d705e38eb9db6dad637750ae754f01bab&auth_token=a8efa78dc776c2c8e4358c2c9ee5be09dd7326ac&limit=21&offset=0&wantColumns=1&wantParameters=1&wantCount=1¶msFormExcludes=[]¤tUser=3&ownGroups=0&ownLocality=0&ownData=0&taxon_groups=&searchArea=&idlist=&location_id=&occattrs=&smpattrs=
Server response
{"error":"general_errors.There was an SQL error: ERROR: column \"website_ids\" does not exist\nLINE 13: CASE WHEN w.id IN (#website_ids#) THEN '' ELSE w.title || '-...\n ^ - \n SELECT o.id as occurrence_id,\nw.title || ' | ' || o.survey_title as source,\no.sample_id as sample_id,\nCASE WHEN o.preferred_taxon=o.default_common_name then o.preferred_taxon ELSE o.preferred_taxon || COALESCE(' | ' || o.default_common_name, '') END as taxon,\no.taxon_group as taxon_group,\no.taxa_taxon_list_id as taxa_taxon_list_id,\no.location_name as location_name,\nregexp_replace(o.public_entered_sref, ',[^ ]', ', ', 'g') as entered_sref,\no.date_start as date_start,\no.date_end as date_end,\no.date_type as date_type,\nCASE WHEN w.id IN (#website_ids#) THEN '' ELSE w.title || '-> ' END || CASE WHEN LENGTH(o.recorders)>30 THEN 'Recorder' ELSE o.recorders END as recorder,\no.zero_abundance as zero_abundance,\no.record_status as record_status,\nCASE WHEN CAST(o.created_by_id AS character varying) = '3' AND o.website_id IN (#website_ids#) THEN true ELSE false END as belongs_to_user,\no.certainty as certainty,\nround(length(o.public_entered_sref) \/ 24.0, 2) as fo,\ncase o.record_status when 'C' then case o.certainty when 'C' then 'green' when 'L' then 'orange' when 'U' then 'red' else 'blue' end when 'V' then 'green' when 'D' then 'orange' when 'R' then 'red' else 'black' end as sc,\ncase o.record_status when 'V' then 'green' when 'D' then 'orange' when 'R' then 'red' else 'blue' end as fc,\nlength(o.public_entered_sref) as zi,\nst_astext(o.public_geom) as geom,\no.images as images,\ncase when o.input_form is null then '' else o.input_form end as input_form\n FROM cache_occurrences o\n JOIN websites w on w.id=o.website_id \n \n \n\n WHERE (o.training=false OR o.training IS NULL) AND 1=1 \n AND o.record_status not in ('I','T') AND (0=1 OR o.record_status not in ('D','R'))\n AND (''='' OR st_intersects(o.public_geom, st_geomfromtext('',900913)))\n \n ORDER BY o.id DESC LIMIT 21","code":44,"file":"C:\\xampp\\htdocs\\indicia\\system\\libraries\\drivers\\Database\\Pgsql.php","line":342,"trace":[] 

Maybe the same reason why I can't upload images?

8

Re: Some issues

Nobody who can help me? Updating to the latest version for the Iform and the warehouse clearly did not do the job. I started from a completely fresh install of drupal with the latest Iform from svn and a fresh install of the warehouse (first installing a previous version as said before. The add picture button does not work and no output and sql errors. Is this only me or what is the problem? I'm running out of options...

9

Re: Some issues

So no out of the box solution? :rolleyes: If noby reacts, i think I have to give up trying (it's not that I didn't tried). There is clearly a bug in the warehouse or I'm doing something wrong. :( Both SQL errors keep popping up. Other reports do find (for example survey report).

10

Re: Some issues

I really hoped for some support here. I have not the knowledge of SQL or whatever to find the solution myself.

11

Re: Some issues

Hi Dieter,  John is probably the only person who could look into this in detail. I think he is probably very busy trying to sort out everyone's Drupal security issue from last week and not having the time to check in here, but I'm sure he will look into it when he can.

Gordon Barker
Biological Survey Data Manager
National Trust

12

Re: Some issues

Okay, I await his reply. Hopefully he has time to look into it. It's very annoying that I can't continue for now. Thanks for your reply Gordon.

13

Re: Some issues

Hi Dieter,
Really sorry not to have got back to you - for some reason the forum does not always notify me of new posts and I'd not realised all this discussion was going on! I'll start reading through in detail and will get back to you...
Regards
John

John van Breda
Biodiverse IT

14

Re: Some issues

Hi Dieter,
The first thing we should do is make sure you have a working and up to date warehouse. I just tested it and confirmed the problem you had with the scripts running - apologies for that as I'd recently dropped one of the upgrade scripts into the wrong folder. I've now fixed it though. You could grab the latest 0.9.1 warehouse code using this Subversion command:

svn export "https://indicia.googlecode.com/svn/core/branches/version 0.9.1"

To grab the latest Drupal module code you could use:

svn export https://indicia.googlecode.com/svn/drupal_7/modules/iform/trunk/iform
svn export https://indicia.googlecode.com/svn/drupal_7/modules/indicia_features/trunk/indicia_features

I noted in your error messages, your modules are in sites/all/modules/tags/version 0.9.0, rather than the iform module being in the sites/all/modules/ folder directly. That might cause a few issues, I'm not sure. You definitely want the iform module and indicia_features folders straight in the sites/all/modules folder. You might need to uninstall them then reinstall them from the correct place I think.

Another idea might be for you to try installing the template we use when installing Drupal 7 + Indicia for local record centres. The documentation is at lrc-website-template.readthedocs.org/en/latest/. Have a look - if you think that is the way to go then let me know and I'll sort out the download files you need.

Best wishes
John

John van Breda
Biodiverse IT

15 (edited by dieter 14-11-2014 20:56:10)

Re: Some issues

Thanks John. Still problems with the fresh 0.9.1 warehouse installation when trying to upgrade

The upgrade failed.

An error occurred during the upgrade.

The error was described as:
There was an SQL error: ERROR: column o.privacy_precision does not exist LINE 14: GREATEST(o.sensitivity_precision, o.privacy_precision,... ^ - -- #slow script# -- create 1km index INSERT INTO map_squares (geom, x, y, size) SELECT DISTINCT on ( round(st_x(st_centroid(reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, GREATEST(o.sensitivity_precision, o.privacy_precision, 1000), coalesce(s.entered_sref_system, l.centroid_sref_system))))), round(st_y(st_centroid(reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, GREATEST(o.sensitivity_precision, o.privacy_precision, 1000), coalesce(s.entered_sref_system, l.centroid_sref_system))))), GREATEST(o.sensitivity_precision, 1000) ) reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, GREATEST(o.sensitivity_precision, o.privacy_precision, 1000), coalesce(s.entered_sref_system, l.centroid_sref_system)), round(st_x(st_centroid(reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, GREATEST(o.sensitivity_precision, o.privacy_precision, 1000), coalesce(s.entered_sref_system, l.centroid_sref_system))))), round(st_y(st_centroid(reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, GREATEST(o.sensitivity_precision, o.privacy_precision, 1000), coalesce(s.entered_sref_system, l.centroid_sref_system))))), GREATEST(o.sensitivity_precision, 1000) FROM samples s JOIN occurrences o ON o.sample_id=s.id LEFT JOIN locations l on l.id=s.location_id AND l.deleted=false WHERE coalesce(s.geom, l.centroid_geom) IS NOT NULL; -- create 2km index SELECT DISTINCT on ( round(st_x(st_centroid(reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, GREATEST(o.sensitivity_precision, o.privacy_precision, 2000), coalesce(s.entered_sref_system, l.centroid_sref_system))))), round(st_y(st_centroid(reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, GREATEST(o.sensitivity_precision, o.privacy_precision, 2000), coalesce(s.entered_sref_system, l.centroid_sref_system))))), GREATEST(o.sensitivity_precision, 2000) ) reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, GREATEST(o.sensitivity_precision, o.privacy_precision, 2000), coalesce(s.entered_sref_system, l.centroid_sref_system)) as geom, round(st_x(st_centroid(reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, GREATEST(o.sensitivity_precision, o.privacy_precision, 2000), coalesce(s.entered_sref_system, l.centroid_sref_system))))) as x, round(st_y(st_centroid(reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, GREATEST(o.sensitivity_precision, o.privacy_precision, 2000), coalesce(s.entered_sref_system, l.centroid_sref_system))))) as y, GREATEST(o.sensitivity_precision, 2000) as size INTO temp FROM samples s JOIN occurrences o ON o.sample_id=s.id LEFT JOIN locations l on l.id=s.location_id AND l.deleted=false WHERE coalesce(s.geom, l.centroid_geom) IS NOT NULL; DELETE FROM temp USING map_squares msq WHERE msq.x=temp.x AND msq.y=temp.y AND msq.size=temp.size; INSERT INTO map_squares (geom, x, y, size) SELECT * FROM temp; DROP TABLE temp; -- create 10km index SELECT DISTINCT on ( round(st_x(st_centroid(reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, GREATEST(o.sensitivity_precision, o.privacy_precision, 10000), coalesce(s.entered_sref_system, l.centroid_sref_system))))), round(st_y(st_centroid(reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, GREATEST(o.sensitivity_precision, o.privacy_precision, 10000), coalesce(s.entered_sref_system, l.centroid_sref_system))))), GREATEST(o.sensitivity_precision, 10000) ) reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, GREATEST(o.sensitivity_precision, o.privacy_precision, 10000), coalesce(s.entered_sref_system, l.centroid_sref_system)) as geom, round(st_x(st_centroid(reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, GREATEST(o.sensitivity_precision, o.privacy_precision, 10000), coalesce(s.entered_sref_system, l.centroid_sref_system))))) as x, round(st_y(st_centroid(reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, GREATEST(o.sensitivity_precision, o.privacy_precision, 10000), coalesce(s.entered_sref_system, l.centroid_sref_system))))) as y, GREATEST(o.sensitivity_precision, 10000) as size INTO temp FROM samples s JOIN occurrences o ON o.sample_id=s.id LEFT JOIN locations l on l.id=s.location_id AND l.deleted=false WHERE coalesce(s.geom, l.centroid_geom) IS NOT NULL; DELETE FROM temp USING map_squares msq WHERE msq.x=temp.x AND msq.y=temp.y AND msq.size=temp.size; INSERT INTO map_squares (geom, x, y, size) SELECT * FROM temp; DROP TABLE temp; SELECT DISTINCT ON (o.confidential, o.sensitivity_precision, coalesce(s.entered_sref, l.centroid_sref), coalesce(s.entered_sref_system, l.centroid_sref_system)) coalesce(s.geom, l.centroid_geom) as geom, o.confidential, o.sensitivity_precision, coalesce(s.entered_sref, l.centroid_sref) as entered_sref, coalesce(s.entered_sref_system, l.centroid_sref_system) as entered_sref_system, round(st_x(st_centroid(reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, greatest(o.sensitivity_precision, o.privacy_precision, 1000), coalesce(s.entered_sref_system, l.centroid_sref_system))))) as x1k, round(st_y(st_centroid(reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, greatest(o.sensitivity_precision, 1000), coalesce(s.entered_sref_system, l.centroid_sref_system))))) as y1k, greatest(o.sensitivity_precision, o.privacy_precision, 1000) as size1k, round(st_x(st_centroid(reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, greatest(o.sensitivity_precision, o.privacy_precision, 2000), coalesce(s.entered_sref_system, l.centroid_sref_system))))) as x2k, round(st_y(st_centroid(reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, greatest(o.sensitivity_precision, 2000), coalesce(s.entered_sref_system, l.centroid_sref_system))))) as y2k, greatest(o.sensitivity_precision, o.privacy_precision, 2000) as size2k, round(st_x(st_centroid(reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, greatest(o.sensitivity_precision, o.privacy_precision, 10000), coalesce(s.entered_sref_system, l.centroid_sref_system))))) as x10k, round(st_y(st_centroid(reduce_precision(coalesce(s.geom, l.centroid_geom), o.confidential, greatest(o.sensitivity_precision, o.privacy_precision, 10000), coalesce(s.entered_sref_system, l.centroid_sref_system))))) as y10k, greatest(o.sensitivity_precision, 10000) as size10k, cast(null as integer) as msq_id1k, cast(null as integer) as msq_id2k, cast(null as integer) as msq_id10k INTO temporary interim FROM occurrences o JOIN samples s on s.id=o.sample_id AND s.deleted=false LEFT JOIN locations l on l.id=s.location_id AND l.deleted=false WHERE o.deleted=false; UPDATE interim t SET msq_id1k=msq.id FROM map_squares msq WHERE msq.x=t.x1k AND msq.y=t.y1k AND msq.size=t.size1k; UPDATE interim t SET msq_id2k=msq.id FROM map_squares msq WHERE msq.x=t.x2k AND msq.y=t.y2k AND msq.size=t.size2k; UPDATE interim t SET msq_id10k=msq.id FROM map_squares msq WHERE msq.x=t.x10k AND msq.y=t.y10k AND msq.size=t.size10k; UPDATE interim SET sensitivity_precision=0 WHERE sensitivity_precision IS NULL; SELECT o.id, t.msq_id1k, t.msq_id2k, t.msq_id10k INTO interim2 FROM samples s JOIN occurrences o ON o.sample_id=s.id and o.deleted=false LEFT JOIN locations l on l.id=s.location_id AND l.deleted=false JOIN interim t ON t.entered_sref=coalesce(s.entered_sref, l.centroid_sref) AND t.entered_sref_system=coalesce(s.entered_sref_system, l.centroid_sref_system) AND t.confidential=o.confidential AND t.sensitivity_precision=COALESCE(o.sensitivity_precision, 0) where s.deleted=false; CREATE INDEX ix_interim2 ON interim2(id); UPDATE cache_occurrences co SET map_sq_1km_id=t.msq_id1k, map_sq_2km_id=t.msq_id2k, map_sq_10km_id=t.msq_id10k FROM interim2 t WHERE t.id=co.id; DROP TABLE interim; DROP TABLE interim2; CREATE INDEX ix_cache_occurrences_map_sq_1km_id ON cache_occurrences USING btree (map_sq_1km_id); CREATE INDEX ix_cache_occurrences_map_sq_2km_id ON cache_occurrences USING btree (map_sq_2km_id); CREATE INDEX ix_cache_occurrences_map_sq_10km_id ON cache_occurrences USING btree (map_sq_1km_id);
Please refer to the application log files for more information.

16

Re: Some issues

Hi Dieter
I've fixed the offending script - thanks for pointing it out. If you redo the svn export the only file you need to update is modules/cache_builder/db/version_0_1_2/201401010910_map_squares_populate.sql. Then you can simply revisit index.php/home/upgrade.

Best wishes
John

John van Breda
Biodiverse IT

17

Re: Some issues

I finally had some time to test the update. The upgrade was smooth this time. However, still the same error on for the occurences report! Can you dig into this John why I keep getting this error?

Post's attachments

error.jpg 256.43 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

18

Re: Some issues

Hi Dieter
I've managed to reproduce this now. This report has only been tested when run from a website client connected to the warehouse, which is why you are getting the error. However I agree that it would be better if this report would work correctly when tested from the warehouse, so I'll look into fixing that.
Best wishes
John

John van Breda
Biodiverse IT

19

Re: Some issues

Hi Dieter
I've fixed the problem running this report when logged into the warehouse in the trunk code.
Regards
John

John van Breda
Biodiverse IT

20

Re: Some issues

Still same issue in my warehouse installation...

21 (edited by dieter 10-12-2014 20:59:47)

Re: Some issues

Hi John,
Some Drupal 7 issues I guess, when I run the my records report I get now following message:

Notice: Undefined variable: cookieParams in report_helper::get_report_grid_current_param_values() (line 2238 of C:\xampp\htdocs\funbel\sites\all\modules\iform\client_helpers\report_helper.php).
Warning: array_diff_key() [function.array-diff-key]: Argument #1 is not an array in report_helper::get_report_grid_current_param_values() (line 2238 of C:\xampp\htdocs\funbel\sites\all\modules\iform\client_helpers\report_helper.php).
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in report_helper::get_report_grid_current_param_values() (line 2242 of C:\xampp\htdocs\funbel\sites\all\modules\iform\client_helpers\report_helper.php).
Warning: Invalid argument supplied for foreach() in report_helper::get_report_grid_current_param_values() (line 2255 of C:\xampp\htdocs\funbel\sites\all\modules\iform\client_helpers\report_helper.php).

And did you already check the broken add photo button like I reported already several times? :s It's in the dynamic form. It doesn't do anything.

Thanks in advance,
Dieter

22

Re: Some issues

Hi Dieter
Have you updated your iform module from SVN recently? I think that this is an area I worked on a couple of months back.
Regards
John

John van Breda
Biodiverse IT

23

Re: Some issues

The add photo button is not working for sure. I downloaded everything again today.

Dieter

24

Re: Some issues

Hi Dieter,

Has updating from SVN solved the problem in #21?

The photo upload button is working in many installations. Saying it is not working is not enough information to be able to offer much help. I think you are going to have to do some investigation to work out what is different about your circumstances. I'd be asking what operating system and browser you are using. I'd be trying alternate browsers. I'd be looking for JavaScript errors. I'd be Googling this information in conjunction with Plupload, the file uploader we are using.

Jim Bacon.

25 (edited by dieter 13-12-2014 09:53:53)

Re: Some issues

Hi Jim,

About # 21, nope, unfortunately not solved. When I click it for the first time it doesn't appear, as soon as I refresh the page, tadaa, it's back and doesn't dissapear anymore when loading this page. Since I reinstalled the warehouse and drupal website about a week ago (fresh downloads) it would have been strange that it would disappear since John said he fixed this a few months ago. Yesterday I reinstalled all the drupal modules with the svn files I downloaded yesterday, but nothing changed.

About the button. I do not get any error, I get nothing at all when I hit it. In drupal 6 (with my first trials about a month ago) this button worked. I'm working with windows 7, xampp tried both IE and chrome. Running local on Xampp 1.7.7. I really don't know what I'm doing wrong. I saw irecord is running on drupal 6, maybe I should downgrade for now.