Disabled webform text format -- unable to reenable

Created on 28 February 2025, about 1 month ago

Problem/Motivation

I inadvertently disabled the Webform text format as I was trying to clean up some formats.
I am now unable to re-enable the Webform text format ("webform_default").

When I try to enable it, I get an Access Denied and a login link (I am logged in as an administrator).

Proposed resolution

If I can't enable the text format -- it seems as though, I shouldn't be able to disable it to begin with.
This led to other issues -- which I assume is they the text format says don't edit.... if its not possible to prevent disabling it, perhaps it could say "don't Edit or Disable" to be explicit. I'm not sure why it should be stopped from being enabled.

I made various attempts to reenable it (tweaking the DB on my local dev, re-importing with the new status) but have been unsuccessful. Is there any way to get it reenabled (I have lots of forms and submissions so I think uninstalling and reinstalling would be impractical at best)

🐛 Bug report
Status

Active

Version

6.2

Component

User interface

Created by

🇺🇸United States adriancotter

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

Comments & Activities

  • Issue created by @adriancotter
  • 🇺🇸United States adriancotter

    Looking on Drupal Stackexchange, I see that I should not be able to see the text format -- I'm not sure how I was able to disable it if that was the case...

  • Most of that work took place at 💬 The hidden webform text format leads to text format selects with only one option Active . I don't think it needs to be enabled. It is disabled by default on install. What actual problem is this causing to the site you are working on?

  • 🇺🇸United States adriancotter

    Well the format choice for the webforms reverted to plain text. I thought that was likely a result of me disabling it, but I don't actually see that having changed in config in GIT, this is what I do see. There were some other WYSIWYG text format settings that got changed along with webform.settings:
    - element_format: webform_default
    - mail_format: webform_default
    + element_format: plain_text
    + mail_format: plain_text
    This was not something I did deliberately. So I am not sure what caused that to switch.

    The problem that resulted was that all our emails started having email appear in them - the html all converted to >p<>/p<

    I see that it uses webform_default if "default" is selected in the HTML Editor dropdowns here
    https://sierraclubdrupal.ddev.site/admin/structure/webform/config/elements

  • 🇹🇼Taiwan junsuwhy

    I encountered the same issue. Somehow, I unintentionally changed the #status of the format to false. Initially, after installation, it was set to true (although it appeared as disabled in the formats list). This caused the system to repeatedly prompt me that the format was empty and couldn't be saved whenever I edited webform fields.

    The solution that worked for me was running:

    \Drupal\filter\Entity\FilterFormat::load('webform_default')->setStatus(true)->save();
    

    You can execute this command via drush php or any PHP-executable environment.

    I suspect this issue occurred when I added a new format and modified the order of formats, which somehow set webform_default's #status to false. However, I've been unable to reproduce this behavior afterward.

  • 🇹🇼Taiwan junsuwhy

    I encountered the same issue. Somehow, I unintentionally changed the #status of the format to false. Initially, after installation, it was set to true (although it appeared as disabled in the formats list). This caused the system to repeatedly prompt me that the format was empty and couldn't be saved whenever I edited webform fields.

    The solution that worked for me was running:

    \Drupal\filter\Entity\FilterFormat::load('webform_default')->setStatus(true)->save();
    

    You can execute this command via drush php or any PHP-executable environment.

    I suspect this issue occurred when I added a new format and modified the order of formats, which somehow set webform_default's #status to false. However, I've been unable to reproduce this behavior afterward.

  • 🇹🇼Taiwan junsuwhy

    I encountered the same issue. Somehow, I unintentionally changed the #status of the format to false. Initially, after installation, it was set to true (although it appeared as disabled in the formats list). This caused the system to repeatedly prompt me that the format was empty and couldn't be saved whenever I edited webform fields.

    The solution that worked for me was running:

    \Drupal\filter\Entity\FilterFormat::load('webform_default')->setStatus(true)->save();
    

    You can execute this command via drush php or any PHP-executable environment.

    I suspect this issue occurred when I added a new format and modified the order of formats, which somehow set webform_default's #status to false. However, I've been unable to reproduce this behavior afterward.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇺🇸United States jrockowitz Brooklyn, NY

    I think the webform_default is no longer visible via the UI, and we might be able to close this ticket since we can't reproduce the issue and the suggestion from #6 is a valid fix.

  • 🇺🇸United States jrockowitz Brooklyn, NY

    I think the webform_default is no longer visible via the UI, and we might be able to close this ticket since we can't reproduce the issue and the suggestion from #6 is a valid fix.

  • 🇺🇸United States adriancotter

    A counterpoint jrockowitz -- just uploaded a screenshot from a different site where webform_default is visible. This is a different site from where this problem occurred.

  • Are those sites on the same Drupal core versions?

  • 🇺🇸United States adriancotter

    Yep. The are on the same Drupal Core versions 10.4.5
    webform 6.2.9

  • 🇺🇸United States jrockowitz Brooklyn, NY

    The short answer is people have to upgrade to resolve this issue

  • 🇺🇸United States adriancotter

    Upgrade to what jrockowitz? to have the webform text format hidden?

  • 🇺🇸United States jrockowitz Brooklyn, NY

    6.3.0-beta2

Production build 0.71.5 2024