I am trying to use insert_block to insert a contact block from http://drupal.org/project/constant_contact. In the content node where it gets inserted, all the form labels are rendered, but none of the input fields are (they aren't hidden either -- they simply are not present in the rendered output html at all). If I add the same block via context or the blocks management page, it works (even on the same content page) and if I use PHP to insert the block in the same content node as I try to insert with insert_block it works. Oddly, my PHP is nearly identical to the module code:

$block = block_load('constant_contact', '2');
$block_content = _block_render_blocks(array($block));
$build = _block_get_renderable_array($block_content);
$block_rendered = drupal_render($build);
print $block_rendered;

Any idea why it's behaving this way?

Comments

colin_young’s picture

Issue summary: View changes

Edit grammar.

m1r1k’s picture

Issue summary: View changes

Check other enabled filter which have bigger weight. I think you have HTML or Wysiwyg filter running after insert_block that just strips all unsafe html tags.

granticusiv’s picture

Just in addition to this, in my Filtered HTML "Filter processing order", it appeared that "WYSIWYG Filter" was set to run before "Insert blocks", but they obviously had the same weight and "Insert blocks" was running before "WYSIWYG Filter". I fixed this by swapping them, saving, swapping them back and saving again.

berenddeboer’s picture

Status: Active » Closed (works as designed)