Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
withanage committed Jun 8, 2020
1 parent 2b6df85 commit 14347ee
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions DataciteExportPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ function exportSubmissions($submissionIds)
$exportXml = $DOMDocumentChapter->saveXML();
$fileManager->writeFile($exportFileName, $exportXml);
$response = $this->depositXML($chapter, $exportFileName, false);
$result[$submissionId . ".c" . $chapter->getId()] = ($response != "") ? $chapter->getTitle() . " : " . $response : '';
$result[$submissionId . ".c" . $chapter->getId()] = ($response != "") ? implode($chapter->getTitle()) . " : " . $response : '';
$fileManager->deleteByPath($exportFileName);
}
}
Expand Down Expand Up @@ -258,7 +258,9 @@ function depositXML($object, $filename, $isSubmission)

assert(is_readable($filename));
$payload = file_get_contents($filename);

assert($payload !== false && !empty($payload));
$fp = fopen ($filename, "r");

curl_setopt($curlCh, CURLOPT_VERBOSE, false);
if ($this->isDara()) {
Expand All @@ -268,7 +270,8 @@ function depositXML($object, $filename, $isSubmission)
if (array_key_exists('redeposit', $request->getUserVars())) {
if ($request->getUserVar('redeposit') == 1) {
curl_setopt($curlCh, CURLOPT_PUT, true);
curl_setopt($curlCh, CURLOPT_INFILE, $filename);
curl_setopt($curlCh, CURLOPT_INFILE, $fp);

}
} else {
$datacitePayloadObject = $this->createDatacitePayload($object, $url, $payload, true);
Expand All @@ -278,9 +281,9 @@ function depositXML($object, $filename, $isSubmission)

}


$status = curl_getinfo($curlCh, CURLINFO_HTTP_CODE);
curl_close($curlCh);
fclose($fp);


$this->setDOI($object, $isSubmission, $status, $response, $press, $request, $doi);
Expand Down

0 comments on commit 14347ee

Please sign in to comment.