I disabled two of the core text format (Filtered HTML and Full HTML), but now I would like to reenable them. After I disabled them, however, they disappeared from my format list. When I try to create a new text format of the same name, however, I get a warning that the format exists, so I figure it's got to be around somewhere. Can someone tell me how to renable those formats?

Thanks in advance.

Comments

megan_m’s picture

It looks like this is a bug. See this issue:

http://drupal.org/node/949220

Hopefully they will get this fixed soon. In the meantime, you can re-enable it directly in the database (proceed with caution!). In the table filter_format, find the filter you want to re-enable, and set the status field to 1. Back in Drupal, clear the cache and it should show up. I'm not sure if you have to change the value for "weight" or not...

Woolwich Web Works: Custom web development

shiftymic’s picture

drupalchick ---- where or where does one find "table filter_format" ? Is there a specific file location? I accidentally did this as well........(so still not fixed)

megan_m’s picture

You have to go directly into the database. Probably in phpMyAdmin if you have that available. There should be a table in the database called filter_format. If you browse that table you should see the list of input formats. Any you have disabled will have a 0 in the status field. Change that to 1, clear the cache, and you should see your filters again.

Woolwich Web Works: Custom web development

lloydlively’s picture

Thank you, that fix just saved my butt.

weirdovideo’s picture

This works. You rock.

2pha’s picture

Hard to believe this is still an issue a year and a half later.

vako’s picture

After 4 years it's still an issue also in Drupal 7 !!

jienckebd’s picture

This worked for me but I had to run a script to update my database. Changes wouldn't stick for some reason.

db_update('filter_format')
->fields(
array(
'status' => 1,
)
)
->condition('format', 'full_html')
->execute();

howdytom’s picture

Thank you! Yes you have execute update.php.

Hopefully this bug will be fixed soon.

hmartens’s picture

Thanks Drupalchick! Your tip just saved my behind ;) I disabled Filtered HTML and all the stuff on my website disappeared...so I had to quickly follow your tip and it's all working now and Drupal is happy again :)

Living life in a grande way.

megadutch1956’s picture

Hi Byan,

I mistakenly disabled the HTML Text Format also. I followed the instructions as outlined by DrupalChick but it didn't do any thing for me.

The lines of code you posted, did you mean this to be written as an MySQL script or on the Unix command line?

db_update('filter_format')
->fields(
array(
'status' => 1,
)
)
->condition('format', 'full_html')
->execute();

(I'm pretty new to Drupal.)

I wish the Drupal people would fix this bug!

wooody’s picture

Thank you.

asiby’s picture

Unbelievable. This was filed 4 years ago and it's still a bug that has not been merged into the core even though a patch has been submitted by a community member. I am curious to know what does it take to fix this kind of stuff.

In the mean time, we have just started a new module called tidbits (still in dev waiting to push the code) that will be there just for this kind of stuff, there is nothing to download yet, but we will be adding the following:
- Un-merged useful patches,
- Bringing back needed Drupal features that were removed,
- Implementing useful trick that could be needed in some use cases,
- etc.

Each feature will be option. You just enable the one you need for your site.

Cheer guys.

Live long ... and prosper!

itapplication’s picture

Today I also bump on this issue.

Drupal developer

Drupal Theme developer.

Shivcharan

Hakaku’s picture

Insane that this still hasn't been fixed.

itapplication’s picture

Same issue is also found in Drupal 8

Drupal developer

Drupal Theme developer.

Shivcharan

vako’s picture

Almost 5 years and now it has moved to Drupal 8!
Can't the core Drupal developers notice these issues??

vm’s picture

Can't complaining users read and follow already linked issues in which core drupal developers can be seen actively working on a fix?

vako’s picture

...yes, I saw the linked issues for the last 5 years... :)
I love Drupal, but sometimes it makes me wonder how some of the issues are pending for so many years and over so many versions...

This specific issue is not that hard to fix and it's basically crippling a whole Drupal system!

vm’s picture

This specific issue is not that hard to fix

assessments such as the above make me question why you've not provided the fix. If you've had the fix for the 5 years then your inaction is also part of the problem. no?

vako’s picture

I knew my statement will generate that question ;)
Actually I stopped being a developer 13 years ago. At the time I used C++, Javascript, SAS & Java only. Then worked a little on ASP but never on PHP.
The concept should be the same, that's why I am predicting that it should be an easy fix. But I might be wrong...

Here's my simple suggestion about one solution:
The Core Text Format settings are written in a mySQL table, so if we need to re-establish a deleted format, we can click on a new button on the text format page that says Reset to Default which will re-insert the original entries in that table.

What would you suggest about a solution to this issue?

vm’s picture

My suggestion is to follow the issue in which a patch is being generated for D8 and test it. Provide feedback as necessary.

francescjr’s picture

Until this issue is not fixed, how this can be "workarounded" in D8? I can't see any table called filter_format there.

sagesolutions’s picture

The data now sits inside the 'config' table.

To view the data, do a db query: select collection, name from config where name like 'filter.format%';

Then, you will want to update the data field for the filter format which you disabled, and change the status from a 0 to a 1.

liamknuj’s picture

Also drupal 8, i have the issue with mailchimp campaign text format. I disabled it and now i cant see it anymore. In the config table, it is also not present, maybe because it is not a core text format. So how i can re-enable module text format in D8 ?

liamknuj’s picture

It should be in that table, but after disabling it is not anymore. Took the row from an backupped version (before disabling) and it worked again !

adam3145’s picture

For drupal 7 to do this with drush:
drush sql-query "UPDATE filter_format SET status = '1' WHERE filter_format.format = 'filtered_HTML'";

mrupsidown’s picture

As a D8 workaround you can export and reimport the disabled text format. Worked for me.

  • Go to admin/config/development/configuration/single/export
  • Select "Text format" for the Configuration type and the desired Text format for the Configuration name
  • Copy the configuration
  • Go to admin/config/development/configuration/single/import
  • Select "Text format" for the Configuration type and paste the configuration
  • Change the "status: false" to "status: true" and click "Import"
mmjvb’s picture

You'll receive an 403 on admin/config/development/configuration/single/export otherwise.

luvsharma’s picture

I don't see Full HTML in the D8 admin/config/development/configuration/single/export --> Text Format options.

Come to think of it, I don't remember ever disabling them. But since I am using Acquia's lightning distrib, perhaps they came pre-disabled?

sprite’s picture

Don't even disable the built in text formats ...

Instead go to permissions and restrict the text formats only to the roles that should have access to them.

spritefully yours
Technical assistance provided to the Drupal community on my own time ...
Thank yous appreciated ...

luvsharma’s picture

but i still don't see full html etc. Only Rich and Plain Text available.

knight67’s picture

Thanks mrupsidown

worked great.

webengr’s picture

works if u read careful and implement, important to change status!  thanks.

cayenne’s picture

Well, the referenced table above was not to be found in my Drupal 8.4.x version.  Instead, I had to go to a functioning site and extract from the `config` table the lines for editor.editor.basic_html and filter.format.basic_html, and their long blobs.

Inserted into the config table of the injured site, cleared caches, enabled for users and boom.  It works.  Cannot recall why I got rid of those formats.... 

:)

steveaust’s picture

Thanks Cayenne, it worked for me too!

I also was missing "FULL HTML" in my D8 Lightning (Acquia) Install.
I went over to my local D8 non-lightning install and exported exactly as described by Cayenne.
I then went over to my D8 Lightning and Imported (a simple copy-and-paste. No file exporting / importing is required)
FULL HTML then appears where you expect it,for me, it was in creating a custom block.

It works!  Why Lightning thought it was a smart idea to remove "FULL HTML" is a mystery.

If you do not have access to a 'normal' D8 install, here is the codes:

uuid: dfa9cb7d-d869-46f0-99aa-3df5bcfde6a4
langcode: en
status: true
dependencies:
  module:
    - editor
_core:
  default_config_hash: hewPmBgni9jlDK_IjLxUx1HsTbinK-hdl0lOwjbteIY
name: 'Full HTML'
format: full_html
weight: 1
filters:
  filter_align:
    id: filter_align
    provider: filter
    status: true
    weight: 8
    settings: {  }
  filter_caption:
    id: filter_caption
    provider: filter
    status: true
    weight: 9
    settings: {  }
  filter_htmlcorrector:
    id: filter_htmlcorrector
    provider: filter
    status: true
    weight: 10
    settings: {  }
  editor_file_reference:
    id: editor_file_reference
    provider: editor
    status: true
    weight: 11
    settings: {  }

ulterius’s picture

Even a more dirty trick

mysqldump DB config >config.sql

vi config.sql

1,$s/\\"status\\";b:0/\\"status\\";b:1/g

:wq

mysql DB <config.sql

flush caches

Risc is all yours....

Worked for me.

fanton’s picture

Include this code at the end of index.php file:

\Drupal::configFactory()->getEditable("filter.format.full_html")
  ->set("status",true)
  ->save(true);

This code enables the text format "full_html" (change if it needs someone other).

Then flush the cache, reload the page, and verify that the text format is enabled.

Finally, remove this code.

rmorelli’s picture

Great! 

vincent.hoehn’s picture

Thank you! Works great!

dazimon’s picture

Worked like a charm! Thank you!

gisle’s picture

For the record. This is still bug is till not fixed as of October 2023. See #2502637: Disabled text formats can't be seen in the GUI

The extremely dirty trick in the comment by fanton above works.

- gisle