Hello all,

I made a module for OpenLayers this afternoon and I would like to use it when editing a node.
The module provides a simple block with a custom form inside, you can browse the code here.

I have enabled the "Node edit/add" panel, created a variant for a particular node type, and when I want to add the block, I get this error.

I have checked around the line 4462 of includes/common.inc and if I remove the property '#attached' of my form, I can add the block to the panel.

I'm still debugging ans trying to understand where it comes from, any help is greatly appreciated, thanks.

Comments

pol’s picture

Title: Can't add custom block » Can't add custom block with custom form with JS in it.
pol’s picture

Status: Active » Fixed

Changing:

    $block['content'] = drupal_get_form('olebs_blockswitcher_form', $config);

In

    $block['content'] = drupal_render(drupal_get_form('olebs_blockswitcher_form', $config));

Solved the problem. Closing the issue.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Updated issue summary.