Does not work on clean install

larrychu - February 7, 2007 - 09:15
Project:Filter Default
Version:4.7.x-1.x-dev
Component:Code
Category:bug report
Priority:minor
Assigned:Unassigned
Status:postponed
Description

On a clean install of drupal, after setting up the filter default module as per instructed in README.TXT "Install and activate the Filter Default like every other Drupal module.", the default filter is not selected by default on the create page form. You must save the "default" filter setting under the list tab at least once in order for the default filter module to work.

Steps to reproduce:
Install clean drupal 4.7.5.
Install filter module.
Enable filter module.
Select and save a default format (other than "Filtered HTML") for "authenticated user" or your own role.
Use the create a new page form.

Symptoms:
The "Filtered HTML" format is initially selected.

possible Workaround:
You must save the "default" filter setting under the list tab at least once in order for the default filter module to work.

possible causes:
I think this has to do with this code

      if ($form[$el]['#type'] == 'radio' &&
          $form[$el]['#default_value'] ==
          variable_get('filter_default_format', FILTER_FORMAT_DEFAULT)) {
        debug_var("default",  $default);
        $form[$el]['#default_value'] = $default;
      }

the filter_default_format persistant variable is unsaved initially and FILTER_FORMAT_DEFAULT=0, however the create page form contains 1 as the actual values and does not match the condition.

#1

larrychu - February 7, 2007 - 09:18

I'm sorry if I wasn't clear on that. The workaround is that under admin/input formats, under the "list" tab, you must click "Set Default Format" at least once.

#2

bjaspan - February 8, 2007 - 20:00
Status:active» postponed

All work on this module is postponed until design issues discussed at http://drupal.org/node/108900 are resolved.

#3

larrychu - February 11, 2007 - 01:34

I realize the development is currently tied up... however I just wanted to post that I found a relatively simple solution for this. If we just used the filter_resolve_format function instead of comparing the input format ids directly, we wouldn't have to worry about the cases involving FILTER_FORMAT_DEFAULT.

 
 

Drupal is a registered trademark of Dries Buytaert.