Skip to content

Commit

Permalink
Merge branch 'hotfix-sample_update'
Browse files Browse the repository at this point in the history
  • Loading branch information
johnvanbreda committed Apr 3, 2020
2 parents e9062f1 + 2b011e3 commit 9bb8987
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions application/config/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
*
* @var string
*/
$config['version'] = '3.2.1';
$config['version'] = '3.2.2';

/**
* Version release date.
*
* @var string
*/
$config['release_date'] = '2020-03-30';
$config['release_date'] = '2020-04-03';

/**
* Link to the code repository downloads page.
Expand Down
3 changes: 2 additions & 1 deletion application/models/occurrence.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public function validate(Validation $array, $save = FALSE) {
$metadataFieldChanging = !empty($fields['metadata']) && $fields['metadata']['value'] !== $this->metadata;
$identChanging = !empty($fields['taxa_taxon_list_id']) && $fields['taxa_taxon_list_id']['value'] !== $this->metadata;
$isAlreadyReviewed = preg_match('/[RDV]/', $this->record_status) || $this->record_substatus === 3;
$sampleUpdating = $this->sample && $this->sample->wantToUpdateMetadata;
// Is this post going to change the record status or substatus?
if ($newStatus !== $this->record_status || $newSubstatus !== $this->record_substatus) {
if ($newStatus === 'V' || $newStatus === 'R') {
Expand All @@ -143,7 +144,7 @@ public function validate(Validation $array, $save = FALSE) {
$array->verified_on = NULL;
}
}
elseif ($this->wantToUpdateMetadata && $isAlreadyReviewed) {
elseif (($sampleUpdating || $this->wantToUpdateMetadata) && $isAlreadyReviewed) {
// We are making a change to a previously reviewed record that doesn't
// explicitly set the status. If the change is to the release status
// or occurrence metadata field, then we don't do anything, otherwise
Expand Down

0 comments on commit 9bb8987

Please sign in to comment.