The setting for the URL filter length never comes out of input_formats_get_settings, because the code overwrites its own array:

  foreach ($list as $filter) {
    $form_module = module_invoke($filter->module, 'filter', 'settings', $filter->delta, $input_format->format);
    if (isset($form_module) && is_array($form_module)) {
      $module_variables = array();

      input_formats_api_walk_form($form_module, $module_variables);

      // !!! Core filter module provides 4 filters, so using the module
      // name as key is not safe.
      // You get the setting for URL filter length, then clobber it with the HTML filter's settings.
      $variables[$filter->module] = $module_variables;
    }
    if (!isset($modules[$filter->module])) {
      $modules[$filter->module] = array();
    }
    $modules[$filter->module][] = $filter->delta;
  }
CommentFileSizeAuthor
#1 1084314-input_formats.patch631 bytesdagmar

Comments

dagmar’s picture

Status: Active » Needs review
StatusFileSize
new631 bytes

Hm, really interesting, I never saw that.

Well, what do you think @joachim, merging the array with the previous arrays variable would work? After all the variable names are different.

joachim’s picture

I was going for:

  foreach ($list as $filter_id => $filter) {
// ... snip
      $variables[$filter_id] = $module_variables;

The filter list already comes keyed as MODULE/DELTA, so that's safe to key by.

But I'm not sure on what happens to that array further down, so your solution could be just as good :)

nterbogt’s picture

This issue is causing me, well, issues :) Is there a timeframe for when this might be fixed and pushed into a release?

joachim’s picture

If you look at the 6.x-2.x branch (currently only in git) I've started work on an API module. I'd forgotten about this problem, but I changed the way settings are arranged in the filter info array, and I seem to remember seeing the URL filter length in there when testing!

nterbogt’s picture

That's great news.

Something else that has been bothering me, but may be able to be resolved with 2.x is that you can't revert an input format in the database back to what is on the filesystem. Once an input format has been changed in the database, it seems to stay there. Even if the values are exactly the same as what is on the filesystem, features shows it as 'Default' but the input format page shows it as 'Overridden'.

Happy to create a new issue for this if you would prefer.