Hello, when an attribute has a default value in the filter rules but this attribute is not declared in the content source, so the attribute is not added to the output (normally this must be added with the default value).

I have made a little patch to correct this, in wysiwyg_filter.module on line 679, replace :


    $attribute_options = (isset($allowed_attributes[$attrname]) ? $allowed_attributes[$attrname] : array());

    // When no attribute value has been specified in parsed HTML stream,
    // then supply default value if provided by input format settings.
    if (!isset($attrinfo['value']) && isset($attribute_options['default'])) {
      $attrinfo['value'] = $attribute_options['default'];
    }

by :


    $attribute_options = (isset($allowed_attributes[$attrname]) ? $allowed_attributes[$attrname] : array());

then replace on line 670 :


      return FALSE;
    }

by :


      return FALSE;
    }
	
    // When no attribute value has been specified in parsed HTML stream,
    // then supply default value if provided by input format settings.
    if (!isset($attrinfo['value']) && isset($allowed_attributes[$attrname]['default'])) {
	  $attrarr[$attrname] = array('value' => $allowed_attributes[$attrname]['default'], 'delimiter' => '"');
    }

Now, attributes with default value will be added to the output even if they are not declared in the content source

CommentFileSizeAuthor
#2 wysiwyg_filter-D6.patch1.31 KBsinasquax
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

markus_petrux’s picture

Status: Active » Needs work

Could you please provide a patch?

http://drupal.org/patch/create

sinasquax’s picture

FileSize
1.31 KB

Yes, i have attached it.

Thank you

markus_petrux’s picture

Status: Needs work » Fixed

Committed to CVS. Thank you!

This does not seem to be a critical issue, so I'll wait for a few days before creating a new release, just in case anything else arises.

sinasquax’s picture

Thank you

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.