Skip to content

Commit

Permalink
fix: only last unregistered DwC field appears in Specimen Record page
Browse files Browse the repository at this point in the history
A prior commit [ d1bae77 ]
renamed multiple references from 'record' to 'localRecord' during the
construction of the RecordPage JSX element,
and this reference might have accidentally been skipped.

It appears the intent was to pre-emptively define localRecord['other']
as an array to avoid calling push() on <undefined>.
But by not also renaming this 'record' reference, localRecord['other']
was constantly being reset as a blank array.

*DwC = Darwin Core

(cherry picked from commit a68fbff)
  • Loading branch information
valdeza committed Aug 21, 2024
1 parent 224b428 commit 1f787a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion public/client/js/react/src/record.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ const RecordPage = ({ record }) => {
const dif = _.difference(Object.keys(canonical), has);
_.each(dif, function (item) {
if (item.indexOf('idigbio:') === -1) {
if (_.isUndefined(record['other'])) {
if (_.isUndefined(localRecord['other'])) {
localRecord['other'] = [];
}
const datum = {};
Expand Down

0 comments on commit 1f787a1

Please sign in to comment.