Disable paragraph delete button based on configuration setting.

Created on 21 October 2024, about 2 months ago

Problem/Motivation

Currently, there is no option to disable the delete button for paragraphs in the frontend editing interface, which can lead to accidental deletions and limited control for certain users. Even with the confirmation step, some authors move to quickly and inadvertently remove a paragraph when they shouldn't.

Proposed resolution

Introduce a configuration option "disable_paragraph_delete" that, when enabled, hides the delete button from the frontend editing interface for paragraphs.

Remaining tasks

  • Test the patch to ensure it hides the delete button when configured.
  • Ensure the configuration is correctly saved and loaded in the settings form.
  • Verify that normal delete permissions remain unaffected.

User interface changes

A new checkbox option labeled "Disable Deleting of Paragraphs" will be added to the frontend editing UI settings form, allowing users to toggle the delete button visibility.

✨ Feature request
Status

Needs review

Version

1.8

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jv24

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

Comments & Activities

  • Issue created by @jv24
  • πŸ‡©πŸ‡ͺGermany a.dmitriiev

    Thank you for the issue and a patch, but I am not sure that having a checkbox for each action will be good idea. There are a lot of access checks that work properly with Drupal permission system and for other buttons like add/move there are additional events emitted that you can subscribe to.

    Probably in your use case it is better to implement form alter hook and remove the "Delete" button if it is confusing for your editors. You can find an example of form alter that targets the form in the sidebar in frontend_editing.module file function frontend_editing_form_alter().

Production build 0.71.5 2024