Skip to content

Commit

Permalink
Merge branch 'fixErrors-893' into 'main'
Browse files Browse the repository at this point in the history
Fixes plugin errors

See merge request softwares-pkp/plugins_ojs/thoth-omp-plugin!26
  • Loading branch information
thiagolepidus committed Sep 27, 2024
2 parents 9c786f2 + e8d1c47 commit 64f3128
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion ThothPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import('plugins.generic.thoth.classes.ThothNotification');
import('plugins.generic.thoth.classes.ThothRegister');
import('plugins.generic.thoth.classes.ThothUpdater');
import('plugins.generic.thoth.lib.thothAPI.exceptions.ThothException');

class ThothPlugin extends GenericPlugin
{
Expand Down Expand Up @@ -128,7 +129,7 @@ public function getThothClient($contextId = null)
$password = $this->getSetting($contextId, 'password');

if (!$email || !$password) {
throw new ThothException("Credentials not configured");
throw new ThothException("Credentials not configured", 0);
}

import('plugins.generic.thoth.lib.APIKeyEncryption.APIKeyEncryption');
Expand Down
4 changes: 4 additions & 0 deletions classes/services/ThothContributionService.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ public function register($thothClient, $author, $thothWorkId)
$contribution = $this->newByAuthor($author);
$contribution->setWorkId($thothWorkId);

if (!$contribution->getContributionType()) {
return;
}

$contributors = ThothService::contributor()->getMany($thothClient, [
'limit' => 1,
'filter' => (!empty($author->getOrcid())) ?
Expand Down
4 changes: 2 additions & 2 deletions version.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<version>
<application>thoth</application>
<type>plugins.generic</type>
<release>0.1.0.0</release>
<date>2024-09-17</date>
<release>0.1.1.0</release>
<date>2024-09-27</date>
<lazy-load>1</lazy-load>
<class>ThothPlugin</class>
</version>

0 comments on commit 64f3128

Please sign in to comment.