When the user is only a reviewer without manage workflow participants permission, there is no weight assigned for the "cancel" and the "Remove me as reviewer" buttons.

Comments

sukanya.ramakrishnan created an issue. See original summary.

sukanya.ramakrishnan’s picture

Submitting a patch for the same

jhedstrom’s picture

+++ b/src/Form/WorkflowParticipantsForm.php
@@ -105,8 +105,8 @@ class WorkflowParticipantsForm extends ContentEntityForm {
-    $form['editors']['#access'] = FALSE;
-    $form['reviewers']['#access'] = FALSE;

Doesn't this cascade down? I'm surprised denying access at this level would then allow access at the widget level?

We have tests for this in AdminUiTest::testReviewerUi():

    $this->assertSession()->buttonExists(t('Remove me as reviewer'));
    $this->assertSession()->buttonExists(t('Cancel'));
    $this->assertSession()->fieldNotExists(t('Editors'));
    $this->assertSession()->fieldNotExists(t('Reviewers'));

so something must be off in that test...

sukanya.ramakrishnan’s picture

Title: Workflow participants form messed up for Reviewers » Need weights for some action buttons for the workflowparticipants form
Category: Bug report » Task
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new685 bytes

Ooh, @jhedstrom Thanks for that insight , the access does trickle down...There was a form alter in our code that was changing stuff :(

Submitting a patch just to assign weights to the buttons only.

Thanks,
Sukanya

jhedstrom’s picture

Status: Needs review » Fixed

Looks good. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.