From d032a9c6af8e64ea365ad8d3c2bb8259a17c0877 Mon Sep 17 00:00:00 2001 From: withanage Date: Tue, 7 Feb 2023 10:16:56 +0100 Subject: [PATCH] https://github.com/pkp/orcidProfile/issues/229 OrcidProfilePlugin-705 --- OrcidProfilePlugin.php | 6 ++++-- locale/en_US/emails.po | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/OrcidProfilePlugin.php b/OrcidProfilePlugin.php index 145f97f7..e6e9ac09 100755 --- a/OrcidProfilePlugin.php +++ b/OrcidProfilePlugin.php @@ -190,7 +190,7 @@ public function register($category, $path, $mainContextId = null) Hook::add('Mailer::Mailables', [$this, 'addMailable']); Hook::add('Form::config::before', [$this, 'addOrcidFormFields']); - Hook::add('Author::edit', [$this, 'handleAuthorFormExecute']); + Hook::add('Author::edit', [$this, 'handleAuthorFormExecute']); } @@ -1444,6 +1444,8 @@ public function setCurrentContextId($contextId) */ public function addMailable(string $hookName, array $args): void { - $args[0] = array_merge($args[0], [OrcidCollectAuthorId::class, OrcidRequestAuthorAuthorization::class]); + foreach ([OrcidCollectAuthorId::class, OrcidRequestAuthorAuthorization::class] as $mailable) { + $args[0]->push($mailable); + } } } diff --git a/locale/en_US/emails.po b/locale/en_US/emails.po index 7fb3d2ad..689f8d2f 100644 --- a/locale/en_US/emails.po +++ b/locale/en_US/emails.po @@ -81,3 +81,9 @@ msgstr "ORCID OAuth authorization link" msgid "emailTemplate.variable.orcidAboutUrl" msgstr "URL to the page about ORCID" + +msgid "plugins.generic.orcidProfile.orcidRequestAuthorAuthorization.name" +msgstr "" + +msgid "plugins.generic.orcidProfile.orcidCollectAuthorId.name" +msgstr ""