Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- [679](https://github.com/thoth-pub/thoth/issues/679) - Remove extraneous <custom_metadata> tag from Crossmark block in Crossref DOI deposit export when an Imprint has recorded a Crossmark DOI but a Work has no license or funding metadata.

## [[0.13.8]](https://github.com/thoth-pub/thoth/releases/tag/v0.13.8) - 2025-03-26
### Added
Expand Down
5 changes: 1 addition & 4 deletions thoth-app/src/component/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,7 @@ impl ToOption for String {
}

fn to_opt_date(self) -> Option<chrono::NaiveDate> {
match chrono::NaiveDate::parse_from_str(&self, "%Y-%m-%d") {
Ok(date) => Some(date),
Err(_) => None,
}
chrono::NaiveDate::parse_from_str(&self, "%Y-%m-%d").ok()
}
}

Expand Down
6 changes: 1 addition & 5 deletions thoth-app/src/service/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ impl AccountService {
}

pub fn get_token(&self) -> Option<String> {
if let Ok(token) = LocalStorage::get(SESSION_KEY) {
Some(token)
} else {
None
}
LocalStorage::get(SESSION_KEY).ok()
}

pub fn set_token(&self, token: String) {
Expand Down
8 changes: 6 additions & 2 deletions thoth-export-server/src/xml/doideposit_crossref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,12 @@ fn write_crossmark_funding_access<W: Write>(
}

// If crossmark metadata is included, funding and access data must be inside the <crossmark> element
// within <custom_metadata> tag
write_element_block("custom_metadata", w, |w| write_work_funding_access(work, w))
// within <custom_metadata> tag. If no funding or access data exist, don't include <custom_metadata> tag.
if work.license.is_some() || !work.fundings.is_empty() {
write_element_block("custom_metadata", w, |w| write_work_funding_access(work, w))
} else {
Ok(())
}
})?;
// If no crossmark metadata, funding and access data go here
} else {
Expand Down