Problem/Motivation

Just accidentally clicked the 'clear values' button while testing something locally. I know for a fact that at some point a client will do this and hit the 'yes' button on the next page without reading it! It would be nice to remove the permission to perform this action for my site editors!

Steps to reproduce

  1. Add loads of data on a config page.
  2. Click the 'clear values' button.
  3. Ignore the lovely warning that is presented because you're in a rush.
  4. Oh no! The data is gone
  5. Run away and cry (optional)

Proposed resolution

Add a permission to clear values so that is can be given to trusted users at the discretion of the site administrator.

User interface changes

The button will be removed by default until the permission is added.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

darren.fisher created an issue. See original summary.

d.fisher’s picture

Status: Active » Needs review

I've added a MR for this. Here's the patch.
https://git.drupalcode.org/project/config_pages/-/merge_requests/45.patch

After digging in to the code I can see that 'administer config_pages types' permission does add some security around clients accidentally clicking the button, but it might be nicer to have this broken out into its own permission. Let me know what you think either way!

d.fisher’s picture

Any thoughts on this?

bhogue’s picture

I can confirm that this new permission works as intended.

shumer made their first commit to this issue’s fork.

  • 0f9b7908 committed on 8.x-2.x
    Issue #3523183 by d.fisher: Add permission to use the clear values...
shumer’s picture

Status: Needs review » Reviewed & tested by the community
shumer’s picture

Status: Reviewed & tested by the community » Fixed
d.fisher’s picture

Oh cool! I didn't realise this got merged! Thanks.

d.fisher’s picture

Hi any chance the contribution record could be updated for this issue? I'm not sure how the new system works but when I go here: https://new.drupal.org/contribution-record/10001616 it looks like none of the names have been checked? Thank you.

  • 2699bd6b committed on 8.x-2.x
    [#3523183] feat: Add permission to use the clear values button
    
    By: d....
shumer’s picture

Have no idea how the new system works :)
Just tried to mark check boxes there and save the changes.

d.fisher’s picture

Oh yes that worked. I've been looking into the changes as I maintain a few modules and need to make sure I understand how this new system works. It looks similar to before - but has just moved to a new page instead of being attached directly to the drupal.org issue page as the intention is to migrate issues away from drupal.org and over to gitlab issues instead. Many thanks for looking into it! I appreciate it.

Status: Fixed » Closed (fixed)

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