Skip to content

Conversation

@jardakotesovec
Copy link
Contributor

…isplay

Copy link
Contributor

@Vitaliy-1 Vitaliy-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the code initially was intended to give the author role when adding the submission, right? And this PR restores initial order of thing as the part of adding the author role in the PKPSubmissionController:add() was already there.

// author role that allows self registration.
// They are also assigned the author role
if ($userGroups->isEmpty()) {
Repo::userGroup()->assignUserToGroup(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, if the code already assigned the author permission in the API, why this part was added here? Is it just a permission aspect to the submission wizard?

Copy link
Contributor Author

@jardakotesovec jardakotesovec Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding how things evolved is that originally (3.3, 3.4) we added Author role when the 'Add' api endpoints was hit. But than this issue came about #10929 , where the issue was with our favourite production editor, which is used only be @Tribunal33 :-D. And that was fixed here (loading create submission page) instead of in the original place.

So we have two places where author role is added in 3.5. This PR is trying to adjust it so its again just in one place, but it handles also production editor and also making it work for users who don't have any role.

$userGroupIdPropName = 'userGroupId';

if (isset($params[$userGroupIdPropName])) {
error_log('add 1');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to remove debugging output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants