Content Moderation In Core€¦ · 4/26/2018 reveal.js...

Preview:

Citation preview

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 1/82

Content Moderation In CoreContent Moderation In CoreA Presentation By A Presentation By

on drupal.org on drupal.orgEric SodEric Sod

esodesod

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 2/82

Table Of ContentsTable Of Contents

and

and

, and

, , and

IntroductionOverviewWorkflow Initiative WorkflowsOverviewWorkflows Configuration WorkflowStates Transitions Applying theWorkflowRoles Permissions Node PermissionsUsersModerate ContentRevisionsThe FutureAdd onsHelpful LinksQuestions

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 3/82

IntroductionIntroductionSenior Drupal

Developer at Memorial

Sloan Kettering Cancer

Center (MSKCC).

Work on the team that

produces MSKCC's

public facing web site,

Eight years experience

as a web developer.

www.mskcc.org

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 4/82

Memorial Sloan KetteringMemorial Sloan KetteringMemorial Sloan

Kettering Cancer

Center is the world’s

oldest and largest

private cancer center.

MSKCC has devoted

more than 130 years to

exceptional patient

care, innovative

research, and

outstanding

educational programs.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 5/82

OverviewOverviewThe Content Moderation module allows you to

expand on Drupal's "unpublished" and

"published" states for content.

It allows you to have a published version that is

live, but have a separate working copy that is

undergoing review before it is published.

This is achieved by using to apply

different states to entities as needed.

Workflows

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 6/82

Workflow InitiativeWorkflow Initiative

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 7/82

Content Moderation Is A Part Of TheContent Moderation Is A Part Of TheWorkflow InitiativeWorkflow InitiativeBackgroundBackground

Bring new features for actually managing

content, such as workflows, preview and staging.

Include functionality in core based on what

contrib modules have done for many years.

Workflow Initiative ­

https://www.drupal.org/project/ideas/issues/2721129

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 8/82

Workflow InitiativeWorkflow InitiativeGoalsGoals

Bring major improvements to Drupal’s content

workflow, preview and staging capabilities.

Much of the functionality that is being

implemented takes heavy inspiration from

modules such as .Workbench Moderation

Workflow Initiative ­

https://www.drupal.org/project/ideas/issues/2721129

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 9/82

Workflow InitiativeWorkflow InitiativePhase C: Content Moderation ModulePhase C: Content Moderation Module

This phase has introduced a module for

moderating the publishing state on individual

content entities.

Plan issues:

#2755073: WI: Content Moderationmodule roadmaphttps://www.drupal.org/project/drupal/issues/2755073

#2843494: WI: Workflows moduleroadmaphttps://www.drupal.org/project/drupal/issues/2843494

Workflow Initiative ­

https://www.drupal.org/project/ideas/issues/2721129

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 10/82

Workflows OverviewWorkflows OverviewThe Drupal 8 Workflows module allows you to

manage workflow with states and transitions.

is a core module that

harnesses the Workflows module to allow

revisionable content entities to move between

different moderation states.

Content Moderation

Workflows Overview ­

https://www.drupal.org/docs/8/core/modules/workflows

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 11/82

Workflows ConfigurationWorkflows ConfigurationEnabling the

module creates a

default Workflow

called "Editorial"

that can be used for

custom block types

or content types.

ContentModeration

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 12/82

Configuring A WorkflowConfiguring A WorkflowA workflow consists of "States" and "Transitions".

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 13/82

What is a workflow, really?What is a workflow, really?

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 14/82

WorkflowWorkflow

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 15/82

Content Moderation WorkflowContent Moderation WorkflowContent Moderation Module - Out Of The BoxContent Moderation Module - Out Of The Box

Image credit ­ Kim Pepper, DrupalSouth 2017

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 16/82

Content Moderation WorkflowContent Moderation WorkflowAdd A ReviewerAdd A Reviewer

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 17/82

StatesStates

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 18/82

StatesStatesStates are the different statuses your content can

have

such as Draft, Published, etc.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 19/82

StatesStatesAdd two new states to customize our workflow:

"Review" and "Request publish"

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 20/82

StatesStatesStates can be

"Published" and/or

a "Default revision".

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 21/82

StatesStatesA state marked

"Published"

updates the core

publishing status to

published.

Otherwise it is

updated to

unpublished.

A state marked

"Default revision"

updates the current

revision to be the

default revision

when loading the

entity.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 22/82

StatesStatesFor our new states, "Published" and "Request

publish" should be unchecked, since neither state is

a published state.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 23/82

Content Moderation WorkflowContent Moderation WorkflowStates Have Been Added To Our WorkflowStates Have Been Added To Our Workflow

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 24/82

TransitionsTransitions

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 25/82

TransitionsTransitionsTransitions are the actual workflow that moves

the content between states.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 26/82

TransitionsTransitionsThese are the

default transitions

that come

configured with the

Editorial workflow.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 27/82

TransitionsTransitionsTo make the new

"Review" state

useful, add two

transitions: "Ready

for review" and

"Request publish".

"Ready for review"

will move content

back and forth

between the Draft

and Review states.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 28/82

TransitionsTransitionsWe also need to add

the "Review" state

to the "Create New

Draft" transition.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 29/82

TransitionsTransitionsThe "Request

publish" transition

will allow content

under "Review" to

be changed to the

state 'Request

publish".

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 30/82

TransitionsTransitionsTo make the new

"Request publish"

state useful, add the

"Request publish"

state to the

"Publish" transition

to allow content

under "Request

publish" to be

published.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 31/82

Content Moderation WorkflowContent Moderation WorkflowTransitions Have Been Added To OurTransitions Have Been Added To OurWorkflowWorkflow

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 32/82

Applying The WorkflowApplying The Workflow

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 33/82

Applying The WorkflowApplying The WorkflowArrange The Order Of States And TransitionsArrange The Order Of States And TransitionsTo Your Liking.To Your Liking.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 34/82

Applying The WorkflowApplying The WorkflowThe Editorial

workflow has not

been applied to any

content types yet.

So, there is no

change on the

create/edit node

form.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 35/82

Applying The WorkflowApplying The WorkflowOn the

admin

page, follow these

simple steps.

Now, the create/edit

node form looks like

this ...

Editorialworkflow

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 36/82

Applying The WorkflowApplying The WorkflowLet's compare the

before and after.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 37/82

Applying The WorkflowApplying The WorkflowBeforeBefore AfterAfter

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 38/82

But Wait!But Wait!Which roles get to create drafts, do reviews,

publish content and archive (unpublish) content?

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 39/82

Roles And PermissionsRoles And Permissions

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 40/82

RolesRoles

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 41/82

RolesRoles

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 42/82

PermissionsPermissions

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 43/82

Permissions For AuthorsPermissions For Authors

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 44/82

Permissions For ReviewersPermissions For Reviewers

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 45/82

Permissions For PublishersPermissions For Publishers

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 46/82

Node PermissionsNode Permissions

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 47/82

Node PermissionsNode PermissionsThe Author role has

permission to create

and edit own Basic

pages, as well as

viewing and

reverting revisions.

The Editor role has

additional

permissions

such as editing of

any Basic page, as

well as deleting.

The Publisher role

has additional

permissions.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 48/82

UsersUsers

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 49/82

Content ModerationContent ModerationUsersUsers

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 50/82

Now that Workflow, Content Moderation

Permissions,

Node Permissions and Users are configured, let's ...

Moderate Content!Moderate Content!

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 51/82

Moderate Content!Moderate Content!The author creates a page and saves it as a Draft.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 52/82

Moderate Content!Moderate Content!The new Content Moderation entity moderation

form

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 53/82

Moderate Content!Moderate Content!The Content Moderation entity moderation form

can be altered with hook_form_FORM_ID_alter()

/**

* Implements hook_form_FORM_ID_alter().

*/

function MY_MODULE_form_content_moderation_entity_moderation

$user = \Drupal::currentUser();

if (empty($user) || !($user->hasPermission('administer sit

$form['#access'] = FALSE;

}

}

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 54/82

Moderate Content!Moderate Content!The author makes an edit and changes the state to

Review.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 55/82

Moderate Content!Moderate Content!The moderation state is now "Review".

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 56/82

Moderate Content!Moderate Content!The Reviewer takes over.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 57/82

Moderate Content!Moderate Content!The Publisher takes over.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 58/82

Moderate Content!Moderate Content!The content page is now published. Anyone with

permission to view published content will be able

to view the page.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 59/82

Moderate Content!Moderate Content!The author edits the page and saves the new edit as

a Draft.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 60/82

Moderate Content!Moderate Content!The author can view the latest version of the

content page in the new Latest version tab.

The Latest version of the content page is a

revision and is not publicly viewable.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 61/82

Moderate Content!Moderate Content!At this time, the author, and anyone else with

permission to view published content, can

continue to view the published version of the

content.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 62/82

Moderate Content!Moderate Content!The publisher can publish the draft from the

form in the latest version tab.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 63/82

Moderate Content!Moderate Content!The publisher can also publish the draft in the node

edit form.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 64/82

Moderate Content!Moderate Content!Now the author and anyone else with permission

to view published content, can view the edited

content.

Note the Latest version tab has, rightly, gone

away.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 65/82

Where Does All Of This Happen?Where Does All Of This Happen?

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 66/82

RevisionsRevisions

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 67/82

Roll Back To A Previous RevisionRoll Back To A Previous Revision

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 68/82

Revert A RevisionRevert A Revision

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 69/82

The Revision Is Now The Latest VersionThe Revision Is Now The Latest Version

Until it is published, reviewed, edited, and finally

published.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 70/82

The Revision Is Published.The Revision Is Published.

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 71/82

The FutureThe FutureFor The Workflow InitiativeFor The Workflow Initiative

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 72/82

RoadmapRoadmapPhase E: Introduce Trash ModulePhase E: Introduce Trash ModulePhase E will leverage the new workflow module

and implement Trash as a new status.

Plan issues:

WI: Phase E: Introduce Trash modulehttps://www.drupal.org/project/ideas/issues/2786135

Workflow Initiative ­

https://www.drupal.org/project/ideas/issues/2721129

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 73/82

RoadmapRoadmapTrash ModuleTrash Module

WI: Phase E: Introduce Trash module ­

https://www.drupal.org/project/drupal/issues/2725449

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 74/82

RoadmapRoadmapPhase G: Introduce Workspace ModulePhase G: Introduce Workspace Module

A workspace is a copy of the live site, that exists

in parallel to the live site. Use a workspace when

you want to prepare multiple new content items,

that you want to go live at the same time, in a

controlled manner.

Plan issues:

WI: Phase G1: Workspace modulehttps://www.drupal.org/project/drupal/issues/2755073

WI: Phase G2: Full­site preview withWorkspace UIhttps://www.drupal.org/project/drupal/issues/2732081

Workflow Initiative ­

https://www.drupal.org/project/ideas/issues/2721129

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 75/82

RoadmapRoadmapPhase H: Workspace Conflict ManagementPhase H: Workspace Conflict Management

This phase will extend the Workspace module to

provide conflict management for content

changes in separate workspaces.

Plan issue:

WI: Phase H: Replication and conflictmanagementhttps://www.drupal.org/project/drupal/issues/2867707

Workflow Initiative ­

https://www.drupal.org/project/ideas/issues/2721129

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 76/82

RoadmapRoadmapPhase X: Cross Site Content StagingPhase X: Cross Site Content StagingThis phase would implement support for cross site

content staging.

Workflow Initiative ­

https://www.drupal.org/project/ideas/issues/2721129

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 77/82

RoadmapRoadmapPhase XI: AutosavePhase XI: AutosaveBig phase. This will be a separate module.

Lots of details still to be figured out.

Workflow Initiative ­

https://www.drupal.org/project/ideas/issues/2721129

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 78/82

Add OnsAdd OnsContrib ModulesContrib Modules

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 79/82

Add OnsAdd OnsThe module adds to the revision tab like

standard Drupal but it also allows pretty viewing of

all added/changed/deleted words between

revisions.

CoreCore DiffDiff

diff

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 80/82

Add OnsAdd OnsThe The moderation

Sidebar provides

an off-canvas menu to moderate the current Entity.

Moderation Sidebar

4/26/2018 reveal.js

file:///Users/sode/Documents/reveal.js/index.html#/80 82/82

Thank YouThank YouQuestions?Questions?