feat: make DOI optional for manual entry in citation form#1373
feat: make DOI optional for manual entry in citation form#1373NishaSharma14 merged 6 commits intodevelopmentfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## development #1373 +/- ##
=================================================
+ Coverage 71.45% 71.57% +0.12%
- Complexity 2417 2435 +18
=================================================
Files 210 210
Lines 9324 9371 +47
=================================================
+ Hits 6662 6707 +45
- Misses 2662 2664 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| // Set overall citations validation status and store detailed report | ||
| if ($citationsStatus) { | ||
| $report['project']['citations'] = 'true|required'; | ||
| } else { | ||
| $report['project']['citations'] = 'false|required'; | ||
| $status = false; // Propagate to project status | ||
| } | ||
|
|
||
| // Store detailed citations validation data separately | ||
| $report['project']['citations_detail'] = $citationsValidation; |
There was a problem hiding this comment.
This block overwrites $report['project']['citations'] that was already set earlier from the schema rules (e.g. array|min:1). That loses the original validation result and can also mark citations as true|required when the project has zero citations (empty loop keeps $citationsStatus true). Consider using a separate key (e.g. citations_doi / citations_doi_detail) or extending the existing project/citation rules without clobbering the earlier report values, and ensure the empty-citations case is handled consistently.
| // Set overall citations validation status and store detailed report | |
| if ($citationsStatus) { | |
| $report['project']['citations'] = 'true|required'; | |
| } else { | |
| $report['project']['citations'] = 'false|required'; | |
| $status = false; // Propagate to project status | |
| } | |
| // Store detailed citations validation data separately | |
| $report['project']['citations_detail'] = $citationsValidation; | |
| // Set overall DOI-specific citations validation status without overwriting base citations validation | |
| if (count($citations) === 0) { | |
| $report['project']['citations_doi'] = 'false|required'; | |
| $status = false; | |
| } else { | |
| if ($citationsStatus) { | |
| $report['project']['citations_doi'] = 'true|required'; | |
| } else { | |
| $report['project']['citations_doi'] = 'false|required'; | |
| $status = false; // Propagate to project status | |
| } | |
| } | |
| // Store detailed DOI-specific citations validation data separately | |
| $report['project']['citations_doi_detail'] = $citationsValidation; |
Uh oh!
There was an error while loading. Please reload this page.