Question

I'm attempting to configure an input format on hook_install() with the following code:

module_load_include('inc', 'filter', 'filter.admin');
$form_state = array(
  'values' => array(
    'name' => 'Full HTML',
    'format' => '2',
    'roles' => array(
      1 => 0,
      2 => 0,
      3 => 1,
    ),
  ),
);
$arg = filter_format_load(2);
drupal_execute('filter_admin_format_form', $form_state, $arg);

However this produces the error:

Filter format names need to be unique. A format named Full HTML already exists.

However if I run the same code on hook_init(), then it runs without error.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange
scroll top