Show buttons on node view pages (replacement for Moderation control pseudofield)

Created on 3 November 2019, about 5 years ago
Updated 13 December 2023, 12 months ago

There is a Drupal 7-era sandbox also with the title "Workflow buttons" β†’ also, but it adds buttons to the node view page, which we also want.

Here's that module's description:

The Workflow module supports changing workflow state in either the node edit form or under the Workflow tab. This module streamlines the state-change process by providing buttons (for users with sufficient access) directly in the node content, which will allow the user to change the workflow state to the next or previous available state.

Since then, the Drupal 8 core version of content moderation has provided a pseudo-field which shows a small form on the node view to change the moderation state, at least if it's not already published the latest version. Here's what that looks like on the Find It platform:

Essentially, we want our exact same buttons that we put on the edit form to be able to be printed instead of this.

Using submit buttons may also work around a core bug where this workflow form bypasses node form validation β†’ .

✨ Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

    This i believe caused the problems in πŸ› workflow_buttons should only be loaded/load edit form when relevant Fixed so we have some cleanup here to regain this functionality again, my bad for bringing it in without enough testing and somehow not creating a new branch like i meant to.

  • πŸ‡ΊπŸ‡ΈUnited States beunerd Providence, Rhode Island

    @mlncn

    What functionality is missing / needs to be regained? I've created a branch on the forked code, but I'm not sure what I need to work on.

  • πŸ‡ΊπŸ‡ΈUnited States beunerd Providence, Rhode Island

    @mlncn

    I think this should be marked as fixed and merged in. The "workflow buttons" pseudo field can be placed on any view display via UI/configuration. Its visibility to users, then, is handled by Drupal's standard "workflows" permissions. And please see https://www.drupal.org/project/workflow_buttons/issues/3328538 πŸ› workflow_buttons should only be loaded/load edit form when relevant Fixed for more.

  • Status changed to RTBC about 1 year ago
  • πŸ‡―πŸ‡΅Japan ultrabob Japan

    I found this issue looking for a way to show the workflow buttons on the view for a custom entity. I confirmed that this functionality seems to be in place for nodes, so suggest marking it as fixed. I will likely create a feature request for the ability to add this to custom entities that have a workflow enabled.

  • πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

    Making a release and i guess we can call this fixed for now, but surely we need something more to make this feature actually useful?

    Realizing that same-to-same transitions really don't make sense when viewing a piece of contentβ€” "Save" (or even "Save as Draft") makes no sense when viewing, only "Publish" or "Unpublish (demote to draft)" and stuff like that makes sense.

    Also, it does load maybe more than it has to starting from workflow_buttons_entity_view and src/Plugin/Field/FieldWidget for people who have no permission to edit (and so no permission to use buttons) that we could perhaps bail out of sooner.

  • πŸ‡―πŸ‡΅Japan ultrabob Japan

    I've used this extensively first on nodes and later on other custom entities, for workflows where we need certain people to just review the content, and are not expected to make any changes to it. I control what buttons are displayed with transition permissions, but like you so, I usually hide the same to same transition when on an entity view, rather than the edit form. I'll be talking about this module at DrupalCon should my session be accepted, so I do think this feature is already useful.

  • Status changed to Fixed 12 months ago
  • πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

    Cool, ultrabob! You are using a custom alter to hide the inapplicable transitions/buttons or some other method? Would be great to document or incorporate into the module. Also, made you a maintainer since you have been doing that issue curation work already thank you!

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

Production build 0.71.5 2024