buttons field formatter doesn't show the current state

Created on 15 June 2018, over 6 years ago
Updated 2 March 2023, over 1 year ago

The buttons field formatter doesn't show you the current state, which makes it a bit confusing.

That's ok for entities like Commerce Order, which do something to also show the state when they render the entity.

But for an entity that's using this formatter OOTB, a setting on this plugin to show the current state label is necessary.

🐛 Bug report
Status

Needs review

Component

User interface

Created by

🇬🇧United Kingdom joachim

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.

  • First commit to issue fork.
  • @krystalcode opened merge request.
  • Status changed to Needs review over 1 year ago
  • 🇵🇪Peru krystalcode

    I have created an MR against the latest development versions with the following improvements compared to the latest patch.

    • Removed redundant code for getting the state label, provided by the field type plugin.
    • Set default value to FALSE because that is the current behavior. It would be an unexpected change for applications updating the module that may even go unnoticed, so I think developers should intentionally enable this. If decided otherwise, this should be pointed out in the release notes.
    • Small improvement in the settings form element description.
    • Removed the "Current state:" prefix when rendering the state. Using the field label is clear and consistent in styling; the label is clear that this is the state and it is clear that the buttons represent the available transitions thus I see no ambiguity. I have tested with either the "inline" and "above" label display and it works fine with standard admin themes such as Claro.
  • 🇵🇪Peru krystalcode

    Uploaded a screenshot of how it looks like with commerce_license.

Production build 0.71.5 2024