I am facing issues with user invitation on 2 different OJS 3.5 installations, but in the same file lib/pkp/classes/invitation/invitations/userRoleAssignment/helpers/UserGroupHelper.php and similar errors (formatDate).
Both installations are running on WHM/cPanel environment.
Issue 1: Invitation not sent
- PHP version: 8.3
When I click on “Invite user to the role” button, after providing the user’s email, selecting the new role, and setting the start date, the following error is shown on the screen:
PKP\invitation\invitations\userRoleAssignment\helpers\UserGroupHelper::formatDate(): Argument #1 ($timestamp) must be of type string, null given, called in /lib/pkp/classes/invitation/invitations/userRoleAssignment/helpers/UserGroupHelper.php on line 43
- UserGroupHelper.php line 43:
self::formatDate($data['dateStart']),
Full function:
public static function fromArray(array $data): self
{
return new self(
$data['userGroupId'],
$data['masthead'],
self::formatDate($data['dateStart']),
$data['dateEnd'] ? self::formatDate($data['dateEnd']) : null
);
}
On invitation form, there is no option for select an end date for the role, so this field is always empty (null).
Because of this error, I cannot change users’ roles.
Issue 2: New role does not record after user acceptation
- PHP version 8.2
On a different OJS 3.5 installation, I faced the same issue before and solve it with the following change, rewriting UserGroupHelper.php lines 43 and 44:
From:
self::formatDate($data['dateStart']),
$data['dateEnd'] ? self::formatDate($data['dateEnd']) : null
To:
!empty($data['dateStart']) ? self::formatDate($data['dateStart']) : '',
!empty($data['dateEnd']) ? self::formatDate($data['dateEnd']) : '',
With this change, I was able to complete the invitation. However, after the user accepts the new role, it seems that the role is registered but then automatically removed.
(author role was selectec by the user)
Logs recorded during the process:
[07-Oct-2025 05:29:32 America/Sao_Paulo] PHP Warning: Undefined array key "dateEnd" in /lib/pkp/classes/invitation/invitations/userRoleAssignment/resources/BaseUserRoleAssignmentInviteResource.php on line 55
[07-Oct-2025 05:29:45 America/Sao_Paulo] PHP Warning: Undefined array key "dateEnd" in /lib/pkp/classes/invitation/invitations/userRoleAssignment/resources/BaseUserRoleAssignmentInviteResource.php on line 55
[07-Oct-2025 05:29:46 America/Sao_Paulo] PHP Warning: Undefined array key "dateEnd" in /lib/pkp/classes/invitation/invitations/userRoleAssignment/resources/BaseUserRoleAssignmentInviteResource.php on line 55
[07-Oct-2025 05:29:49 America/Sao_Paulo] PHP Warning: Undefined array key "dateEnd" in /lib/pkp/classes/invitation/invitations/userRoleAssignment/resources/BaseUserRoleAssignmentInviteResource.php on line 55
[07-Oct-2025 05:30:09 America/Sao_Paulo] PHP Warning: Undefined array key "dateEnd" in /lib/pkp/classes/invitation/invitations/userRoleAssignment/resources/BaseUserRoleAssignmentInviteResource.php on line 55
[07-Oct-2025 05:30:12 America/Sao_Paulo] PHP Warning: Undefined array key "dateEnd" in /lib/pkp/classes/invitation/invitations/userRoleAssignment/resources/BaseUserRoleAssignmentInviteResource.php on line 55
[07-Oct-2025 05:31:29 America/Sao_Paulo] PHP Warning: Undefined variable $isNewSubmissionLinkPresent in /lib/pkp/classes/template/PKPTemplateManager.php on line 1087
[07-Oct-2025 05:33:42 America/Sao_Paulo] PHP Warning: Undefined array key "dateEnd" in /lib/pkp/classes/invitation/invitations/userRoleAssignment/resources/BaseUserRoleAssignmentInviteResource.php on line 55
[07-Oct-2025 05:33:49 America/Sao_Paulo] PHP Warning: Undefined array key "dateEnd" in /lib/pkp/classes/invitation/invitations/userRoleAssignment/resources/BaseUserRoleAssignmentInviteResource.php on line 55
[07-Oct-2025 05:33:50 America/Sao_Paulo] PHP Warning: Undefined array key "dateEnd" in /lib/pkp/classes/invitation/invitations/userRoleAssignment/resources/BaseUserRoleAssignmentInviteResource.php on line 55
[07-Oct-2025 05:33:54 America/Sao_Paulo] PHP Warning: Undefined array key "dateEnd" in /lib/pkp/classes/invitation/invitations/userRoleAssignment/resources/BaseUserRoleAssignmentInviteResource.php on line 55
[07-Oct-2025 05:34:06 America/Sao_Paulo] PHP Warning: Undefined variable $isNewSubmissionLinkPresent in /lib/pkp/classes/template/PKPTemplateManager.php on line 1087
[07-Oct-2025 05:34:07 America/Sao_Paulo] PHP Warning: Undefined array key "dateEnd" in /lib/pkp/classes/invitation/invitations/userRoleAssignment/resources/BaseUserRoleAssignmentInviteResource.php on line 55
[07-Oct-2025 05:34:14 America/Sao_Paulo] PHP Warning: Undefined array key "dateEnd" in /lib/pkp/classes/invitation/invitations/userRoleAssignment/resources/BaseUserRoleAssignmentInviteResource.php on line 55
[07-Oct-2025 05:34:17 America/Sao_Paulo] PHP Warning: Undefined variable $isNewSubmissionLinkPresent in /lib/pkp/classes/template/PKPTemplateManager.php on line 1087
Because of this behavior, I cannot assign new roles to users via Journal Editor user invitations.

