ArctosDB / arctos

Arctos is a museum collections management system
https://arctos.database.museum
Apache License 2.0
59 stars 13 forks source link

Old Reporter Error #5216

Closed acdoll closed 1 year ago

acdoll commented 1 year ago

I'm trying to print the DZTB report for the following records: https://arctos.database.museum/saved/1666799254700. The old reporter doesn't seem to like my data; is this an issue with the quotes in my Specimen Remarks?: image image

dustymc commented 1 year ago
Screen Shot 2022-10-26 at 8 52 43 AM

It's expecting collection_object_id and not getting it. You might change it to use #table_name# - I can help, but will need more detail.

acdoll commented 1 year ago

Isn't that the first thing pulled in the sql: SELECT flat.collection_object_id, flat.cat_num, flat.scientific_name, flat.ACCESSION accn_number, flat.higher_geog, flat.spec_locality, flat.VERBATIM_LOCALITY, flat.COLLECTING_METHOD, flat.COLLECTING_SOURCE, flat.VERBATIM_DATE, flat.BEGAN_DATE, flat.ENDED_DATE, flat.collectors, flat.remarks, flat.minimum_elevation, flat.orig_elev_units, round(dec_lat::numeric,5) DEC_LAT, round(dec_long::numeric,5) DEC_LONG, concatsingleotherid(flat.collection_object_id,'preparator number') as preparator_number, concatsingleotherid(flat.collection_object_id,'original identifier') as original_identifier, concatsingleotherid(flat.collection_object_id,'secondary identifier') as secondary_identifier, concatsingleotherid(flat.collection_object_id,'DZTB: Denver Zoology Tissue Bird') as DZTB, concatsingleotherid(flat.collection_object_id,'field number') as field_number, concatsingleotherid(flat.collection_object_id,'collector number') as collector_number, concatsingleotherid(flat.collection_object_id,'GWRC: Greenwood Wildlife Rehabilitation Center') as GWRC, concatsingleotherid(flat.collection_object_id,'RMRP: Rocky Mountain Raptor Program') as RMRP, flat.habitat FROM flat WHERE flat.collection_object_id IN (#collection_object_id#) ORDER BY cat_num

acdoll commented 1 year ago

Oh, is collection_object_id not coming from the results list?

dustymc commented 1 year ago

Yes, the variable isn't being set. (I have vague memories of the long list breaking something at TACC a while back.)

acdoll commented 1 year ago

Why does the #collection_object_id# disappear from the sql on the error page. When I changed that to #table_name# it remains there in the error: image (I know that's not exactly what you meant, but I thought I'd see what happened)

dustymc commented 1 year ago

It's evaluated.

?collection_object_id=123-->123

acdoll commented 1 year ago

so, is there something else I should put in instead of #collection_object_id#? we use that in all of our reports.

dustymc commented 1 year ago

https://handbook.arctosdb.org/documentation/reports.html#accepts-variable

....
flat.habitat
FROM
flat
inner join #table_name# on flat.collection_object_id=#table_name#.collection_object_id
ORDER BY
flat.cat_num
acdoll commented 1 year ago

Still not quite there image

dustymc commented 1 year ago

Your saved search and my guess at the report got me something.

Screen Shot 2022-10-26 at 10 56 35 AM
acdoll commented 1 year ago

That's the one, but I can't get it to work. I tried multiple browsers just to be sure, same result. image

acdoll commented 1 year ago

Now I can't get to that server: image

dustymc commented 1 year ago

That's the one,

I'm not so sure about that... - drop the comma after flat

The other thing is usually from too many tabs - you have to follow your last authentication token.

acdoll commented 1 year ago

usually from too many tabs

might have been from being logged in on different browsers, too (?). Logging out of everything then back in (just once) seemed to work.

drop the comma after flat

I had added that after trying it without. I've removed it but still am getting the earlier error. image

dustymc commented 1 year ago

I think you're going to have to share the name of the report if I'm to figure this out.

acdoll commented 1 year ago

DZTB or DMNS_DZTB.cfr

acdoll commented 1 year ago

Ah, you may have used DMNS_DZTB_prepped.cfr - that one does work for me. I don't see much difference in the handlers. I'm sure I just copied the DMNS_DZTB.cfr handler and added a few things to make DMNS_DZTB_prepped.cfr

acdoll commented 1 year ago

I just pasted in the end of the 'prepped' handler in to the original DZTB and now it works. I see no difference other than the indents:

original, non-functional handler for DMNS_DZTB.cfr: FROM flat WHERE flat.collection_object_id IN (#collection_object_id#) ORDER BY cat_num

new, functioning handler for DMNS_DZTB_prepped.cfr: FROM flat WHERE
flat.collection_object_id IN (#collection_object_id#) ORDER BY cat_num

dustymc commented 1 year ago
Screen Shot 2022-10-26 at 1 08 09 PM Screen Shot 2022-10-26 at 1 08 18 PM Screen Shot 2022-10-26 at 1 15 07 PM

templates.DMNS_DZTB.pdf

I'm like 80% sure I got the error once, but I've got too many tabs open too...

And I think the old reporter does have collection_object_id handling, one too many reporters hanging around....

Glad to see your comment pop in, maybe we don't need an exorcist!

Depending on lots of things, indents can disappear from editor to editor resulting in text all smushed together - but that's usually something like notepad, not browser to browser....

acdoll commented 1 year ago

Did you change anything else? Before all of our reports were giving a similar error. Now they seem to be working (no changes to their handlers).

dustymc commented 1 year ago

Nope....

acdoll commented 1 year ago

shrug... Thanks for your assistance!

dustymc commented 1 year ago

Sure, let me know if you need me to do nothing while something magically fixes itself again....