From 1e38cbb0e069c1d8d083a6f1dc7a28b98719b184 Mon Sep 17 00:00:00 2001 From: eblondel Date: Wed, 5 Jun 2024 01:09:48 +0200 Subject: [PATCH] enable grant support back with new zen4R --- inst/actions/zen4R_deposit_record.R | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/inst/actions/zen4R_deposit_record.R b/inst/actions/zen4R_deposit_record.R index 3774bd0..3068b1f 100644 --- a/inst/actions/zen4R_deposit_record.R +++ b/inst/actions/zen4R_deposit_record.R @@ -396,15 +396,14 @@ function(action, entity, config){ } #grants - #TODO missing support in zen4R - # if(length(entity$relations)){ - # grants = entity$relations[sapply(entity$relations, function(x){tolower(x$key) == "grant"})] - # if(length(grants)>0){ - # for(grant in grants){ - # zenodo_metadata$addGrant(grant, sandbox = ZENODO$sandbox) - # } - # } - # } + if(length(entity$relations)){ + grants = entity$relations[sapply(entity$relations, function(x){tolower(x$key) == "grant"})] + if(length(grants)>0){ + for(grant in grants){ + zenodo_metadata$addGrant(grant, sandbox = ZENODO$sandbox) + } + } + } }else{ config$logger.info("Skipping update of Zenodo record metadata (option 'update_metadata' FALSE)")