Skip to content

Commit

Permalink
pkp#10630 Several Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
defstat committed Nov 24, 2024
1 parent 7aed60a commit a0e9f4f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion api/v1/invitations/InvitationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
use PKP\invitation\models\InvitationModel;
use PKP\security\Role;
use PKP\validation\ValidatorFactory;
use Validator;

class InvitationController extends PKPBaseController
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ public function getInvitation(): UserRoleAssignmentInvite
public function acceptHandle(Request $request): void
{
$templateMgr = TemplateManager::getManager($request);
$templateMgr->assign('invitation', $this->invitation);

$this->getInvitation()->changeInvitationUserIdUsingUserEmail();

$templateMgr->assign('invitation', $this->getInvitation());
$context = $request->getContext();
$steps = new AcceptInvitationStep();
$invitationModel = $this->invitation->invitationModel->toArray();
$invitationModel = $this->getInvitation()->invitationModel->toArray();
$user = $invitationModel['userId'] ?Repo::user()->get($invitationModel['userId']) : null;
$templateMgr->setState([
'steps' => $steps->getSteps($this->invitation,$context,$user),
'steps' => $steps->getSteps($this->getInvitation(),$context,$user),
'primaryLocale' => $context->getData('primaryLocale'),
'pageTitle' => __('invitation.wizard.pageTitle'),
'invitationId' => (int)$request->getUserVar('id') ?: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function invite(Request $illuminateRequest): JsonResponse
$this->invitation->getPayload()->sendEmailAddress = $existingUser->getEmail();
}

$this->invitation->getPayload()->inviteStagePayload = $this->invitation->getPayload();
$this->invitation->getPayload()->inviteStagePayload = $this->invitation->getPayload()->toArray();

$this->invitation->updatePayload();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function getValidationRules(UserRoleAssignmentInvite $invitation, Validat
'orcid'
],
'shouldUseInviteData' => [
'prohibited',
new ProhibitedIncludingNull($validationContext === ValidationContext::VALIDATION_CONTEXT_REFINE||$validationContext === ValidationContext::VALIDATION_CONTEXT_POPULATE),
],
];

Expand Down

0 comments on commit a0e9f4f

Please sign in to comment.