Skip to content

Commit

Permalink
2.25.11
Browse files Browse the repository at this point in the history
  • Loading branch information
scottjpearson committed Dec 11, 2020
1 parent 6c425ab commit 319e7a4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CareerDev.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class CareerDev {
public static $passedModule = NULL;

public static function getVersion() {
return "2.25.10";
return "2.25.11";
}

public static function getLockFile($pid) {
Expand Down
1 change: 1 addition & 0 deletions classes/REDCapManagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,7 @@ public static function datetime2Date($datetime) {
}

public static function prefix2CompleteField($prefix) {
$prefix = preg_replace("/_$/", "", $prefix);
if ($prefix == "promotion") {
return "position_change_complete";
} else if ($prefix == "check") {
Expand Down
4 changes: 3 additions & 1 deletion classes/Scholar.php
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,9 @@ private function getAllOtherInstitutions($rows) {
}
}
}
Application::log("In getAllOtherInstitutions, returning ".json_encode($seenInstitutions));
if ($showDebug) {
Application::log("In getAllOtherInstitutions, returning ".json_encode($seenInstitutions));
}
return $seenInstitutions;
}

Expand Down
14 changes: 8 additions & 6 deletions classes/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public static function deleteRecords($token, $server, $records) {
Application::log("Deleted ".$output);

$feedback = json_decode($output, TRUE);
self::testFeedback($feedback);
self::testFeedback($feedback, $output);

return $feedback;
}
Expand Down Expand Up @@ -169,15 +169,17 @@ public static function metadata($metadata, $token, $server) {
curl_close($ch);

$feedback = json_decode($output, TRUE);
self::testFeedback($feedback, $metadata);
self::testFeedback($feedback, $output, $metadata);

self::$useAPIOnly[$token] = TRUE;
Application::log("Upload::metadata returning $output");
return $feedback;
}

private static function testFeedback($feedback, $rows = array()) {
if (isset($feedback['error']) && $feedback['error']) {
private static function testFeedback($feedback, $originalText, $rows = array()) {
if (!$feedback) {
throw new \Exception("Upload error (non-JSON): $originalText");
} else if (isset($feedback['error']) && $feedback['error']) {
Application::log("Upload error: ".$feedback['error']);
throw new \Exception("Error: ".$feedback['error']."\n".json_encode($rows));
}
Expand Down Expand Up @@ -266,7 +268,7 @@ public static function projectSettings($settings, $token, $server) {
curl_close($ch);

$feedback = json_decode($output, TRUE);
self::testFeedback($feedback, $settings);
self::testFeedback($feedback, $output, $settings);

self::$useAPIOnly[$token] = TRUE;
Application::log("Upload::projectSettings returning $output");
Expand Down Expand Up @@ -428,7 +430,7 @@ public static function rows($rows, $token, $server) {
} else {
Application::log("Upload::rows $method returning $output in ".($time3 - $time2)." seconds");
}
self::testFeedback($feedback, $rows);
self::testFeedback($feedback, $output, $rows);
$allFeedback = self::combineFeedback($allFeedback, $feedback);
}
return $allFeedback;
Expand Down

0 comments on commit 319e7a4

Please sign in to comment.