There are 2 ways a DataCollectionGroup can have an experiment type:
By setting the DataCollectionGroup.experimentType to a suitable enum
By setting the DataCollectionGroup.experimentTypeId to a suitable integer, and then getting the ExperimentType.name field.
Synchweb should be able to cope with both.
Changes:
Use IFNULL(ExperimentType.name, DataCollectionGroup.experimentType) to cope with both possible ways, favouring the experimentTypeId route.
Add extra joins to ExperimentType table and add it to the list of valid tables
Remove the counting of experimentTypes in Sample.php, these do not seem to be used anywhere, and there are no data collection groups in the database with experimentType set to 'XRF map', 'XRF spectrum' or 'Energy Scan', and these are not valid names in the ExperimentType table.
To test:
Go to a data collection group eg /dc/visit/cm37235-3/dcg/12121608, check the experiment type is listed as SAD
Check the data collections don't show when you click the "Screenings" filter, but do show when you click the "Full Collections" filter
update DataCollectionGroup set experimentTypeId=7 where dataCollectionGroupId=12121608;, check same page updates to say MAD, filters still work
update DataCollectionGroup set experimentType=null where dataCollectionGroupId=12121608;, check same page still shows MAD, filters still work
Check the /samples page still looks the same
Check the visit stats page (/stats/visit/cm37235-3) still looks the same (I don't believe the _error_log() function is called anywhere)
JIRA ticket: LIMS-1330
Summary:
There are 2 ways a DataCollectionGroup can have an experiment type:
Synchweb should be able to cope with both.
Changes:
To test:
update DataCollectionGroup set experimentTypeId=7 where dataCollectionGroupId=12121608;
, check same page updates to say MAD, filters still workupdate DataCollectionGroup set experimentType=null where dataCollectionGroupId=12121608;
, check same page still shows MAD, filters still work_error_log()
function is called anywhere)