Skip to content

pkp/pkp-lib#10929 Temporary fix for Production Editor's file upload issues #11075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: stable-3_5_0
Choose a base branch
from

Conversation

taslangraham
Copy link
Contributor

For #10929

@taslangraham taslangraham force-pushed the i10929-stable-3_5 branch 2 times, most recently from ff94a7b to 2d81c3e Compare March 12, 2025 20:14
@taslangraham taslangraham marked this pull request as ready for review March 12, 2025 21:52
@@ -664,8 +664,34 @@ public function add(Request $illuminateRequest): JsonResponse
: $submitAsUserGroup->permitMetadataEdit
);

$isSubmittingAsProductionEditor = $submitAsUserGroup->getLocalizedData('name') === __('default.groups.name.productionEditor');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if this is the best way to check for a specific role. Open to suggestions

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the best way would be to check the access to the submission stage through the user group stage table

Copy link
Contributor

Choose a reason for hiding this comment

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

Forgot to mention that OPS might require different treatment - in 3.5 stage ID has only value 5 there, submission stage was removed.

@taslangraham taslangraham requested a review from Vitaliy-1 March 17, 2025 15:39
@taslangraham taslangraham force-pushed the i10929-stable-3_5 branch 2 times, most recently from 3bf5692 to 38709e1 Compare March 27, 2025 17:40
@taslangraham
Copy link
Contributor Author

@Vitaliy-1 Thanks for the review. I've made the updates based on your suggestions.

Also, given that OPS does not have Production Editor group, and production stage (stage ID 5), I've added app level implementation for the SubmissionController::add method in OPS. PR can be found here.

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.

Sorry for the late reply!

The part of code that checks user roles and automatically assigns author role if necessary is here: https://github.com/pkp/pkp-lib/blob/main/pages/submission/PKPSubmissionHandler.php#L615

Thus, it makes senes to move the check there.
Moreover, I don't know what was the initial idea behind that part. In my opinion, it makes sense to check if user has access to the submission stage in general, and if not, assign an author role. That applies, for production editors, which are managers, copyeditors, layout editors, reviewers... and custom user groups.

Also, we might want to exclude user groups without access to submission stage from from the list here: https://github.com/pkp/pkp-lib/blob/main/classes/components/forms/submission/StartSubmission.php#L159

@taslangraham
Copy link
Contributor Author

Thanks @Vitaliy-1, I've made updates based on your suggestions:

  1. Move checks and group assignment to https://github.com/pkp/pkp-lib/blob/main/pages/submission/PKPSubmissionHandler.php#L615
    • Assign user to Author role once user doesn't have access to submission stage
  2. Exclude user groups without access to submission stage from list of "Submit as" options
  3. Keep original behaviour for https://github.com/pkp/pkp-lib/blob/main/pages/submission/PKPSubmissionHandler.php#L615 in OPS (PR)

Take a look and let me know if it makes sense

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