I am using this patch https://drupal.org/node/1870710 to fix the markup component bug. However, I discovered that the input format is also bugged. The markup component always uses the site-default input format, regardless of the format selected when configuring the added markup field.

Comments

avergara’s picture

Issue summary: View changes

added more info

avergara’s picture

Issue summary: View changes

added more info

avergara’s picture

Title: Markup component does not properly save the selected input format » Temporary fix

I disabled form_builder_webform, edited a markup field, saved, then re-enabled form_builder_webform. Even if the input format was properly saved, the input format is not properly used/rendered when the form is displayed.

The problem is related with #input_format

A temporary fix that I am currently using is this:
I modified the function _form_builder_webform_form_builder_map_markup() so that it looks like:

function _form_builder_webform_form_builder_map_markup() {
  return array(
    'form_builder_type' => 'markup',
    'properties' => array(
      'markup' => array(
        'storage_parents' => array('value'),
      ),
      'input_format' => array(
        'storage_parents' => array('extra', 'format'),
      ),
    ),
  );
}

This way, the input format will be properly saved on the database. And then I added this hook on my module:

/**
 * Fix to form_builder_webform module bug where the markup's input format is not properly rendered
 **/
function mymodule_webform_component_render_alter(&$element, $component) {
	if($element['#type'] == 'markup' && isset($element['#format'])) {
		if(isset($element['#input_format']))
			return;
		
		$element['#input_format'] = $element['#format'];
	}
}

so that the input format is properly used/rendered when editing the form

avergara’s picture

Title: Temporary fix » Markup component does not properly save the selected input format
avergara’s picture

Issue summary: View changes

clarification

torotil’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)
Issue tags: +form_builder-6.x-wontfix

It seems that I'm the only active maintainer of form_builder at the moment and I'm not supporting 6.x-1.x since I don't use Drupal 6. Is this also reproducible in 7.x-1.x?