Wrong form structure when reduced to one input format

janusman - December 2, 2008 - 22:05
Project:Filter by node type
Version:6.x-1.2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work
Description

Under my installation, I created a new Input Filter, and using the filterbynodetype module, I designated a content type to use that new filter.

The WYSIWYG module is not detecting myconfiguration, because this evaluates to false:

isset($element['format']['guidelines'])

However, $element['guidelines_link'] does exist.

So I changed these two lines adding "|| isset($element['guidelines_link'])" and it seems to work properly:

line 94:
  if ((isset($element['#type']) && $element['#type'] == 'fieldset') || isset($element['format']['guidelines']) || isset($element['guidelines_link'])) {

line 139:
  if (isset($element['format']['guidelines']) || isset($element['guidelines_link'])) {

Perhaps this is not the correct solution, it just worked for me.

#1

janusman - December 2, 2008 - 22:16
Title:Additional code for proper detection when using » Additional code for proper detection when using Filter by node type module

Missed part of the title.

#2

sun - December 2, 2008 - 22:18
Title:Additional code for proper detection when using Filter by node type module» Wrong form structure when reduced to one input format
Project:Wysiwyg» Filter by node type
Version:6.x-0.5» 6.x-1.2

$element['guidelines_link'] does not conform to Drupal core's form structure:

http://api.drupal.org/api/function/filter_form/6
http://api.drupal.org/api/function/theme_filter_tips_more_info/6
http://api.drupal.org/api/function/theme_filter_tips/6

If filterbynodetype alters the form structure, it should make ensure that the resulting structure equals the default output of filter_form().

Please note that this bug only appears when the available input formats are reduced to only one input format.

#3

sun - December 3, 2008 - 00:26
Status:active» needs review

This works from my testing.

AttachmentSize
filterbynodetype-DRUPAL-6--1.form-structure.patch 2.72 KB

#4

janusman - December 3, 2008 - 14:58
Status:needs review» reviewed & tested by the community

Tested; marking this as RTBC.

#5

heyrocker - May 29, 2009 - 20:23
Status:reviewed & tested by the community» needs work

I'm clearing out the issue queue in preparation to roll a new release. Is this still an issue? I tried to reproduce it with the dev version of filterbynodetype and the current wysiwyg api and couldn't.

Also some code got moved around so if this could be rerolled it would be helpful.

#6

laddiebuck - July 21, 2009 - 01:52

I have this issue too, and am just wondering whether the D5 version will also be patched? Thanks in advance.

 
 

Drupal is a registered trademark of Dries Buytaert.