4

I considered 'restricted HTML' as unnecessary and set it ‘disable’. Because I thought it possible to re-enable. However, I have not found a disabled format on UI.

Since there is no choice, I decided to newly register. The same registration as the default machine name 'restricted_html' conflicts. Imagine the data is left somewhere. I could not find it even if I looked for a database. Is it possible to restore by setting file or something?

I am using Drupal 8.4.2.

2 Answers 2

9

This is a known issue, though you are warned before you disable the textformat that this cannot be undone. See the issue Disabled text formats can't be seen in the GUI and the comment #60:

It is possible to reenable disabled text formats with the configuration manager:

  • go to /admin/config/development/configuration/single/export
  • choose Text format as the Configuration type
  • choose the disabled text format as Configuration Name
  • copy the configuration
  • go to /admin/config/development/configuration/single/import
  • again choose Text format as the Configuration type
  • paste the configuration
  • change "status" from false to true
  • click on import

Voilá, the text format is available again. This is working but not user friendly :(

2
  • Thank you. I understood the setting's export and import. Suddenly, we could not import with the error of L10n_client module. I will execute the Drush command of the message below. Commented Dec 7, 2017 at 13:27
  • After solving the problem of l10n_client module, this problem was solved by your method. Commented Dec 8, 2017 at 6:26
2

More intuitive with drush :

drush ev '\Drupal::configFactory()->getEditable("editor.editor.<EDITOR_ID>")->set("status",true)->save(true);'
drush ev '\Drupal::configFactory()->getEditable("filter.format.<EDITOR_ID>")->set("status",true)->save(true);'

Or

Programmatically :

\Drupal::configFactory()->getEditable('editor.editor.<EDITOR_ID>')
                        ->set('status',true)
                        ->save(true);
\Drupal::configFactory()->getEditable("filter.format.<EDITOR_ID>")
                        ->set("status",true)
                        ->save(true);
8
  • Please tell me what EDITOR_ID is. Is it UUID? Commented Dec 7, 2017 at 13:25
  • Editor id are "basic_html", "full_html" and "plain_text" by default. I guess you talk about "basic_html". Commented Dec 7, 2017 at 13:26
  • Thanks. My case is 'restricted_html'. The drupal command ran without error, but admin/config/content/formats has ‘The website encountered an unexpected error. Please try again later.’ Commented Dec 7, 2017 at 13:52
  • Error log is Drupal\Component\Plugin\Exception\PluginNotFoundException: The "" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 52 of /Users/hogehoge/Sites/devdesktop/d8_drupalproject_tmgmt_moc1/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php). Commented Dec 7, 2017 at 13:56
  • This error is not related to that command, have you missspelled your id ? Commented Dec 7, 2017 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.