This is nothing serious, I just wanna report it anyway. There's nothing wrong with id and class output when just putting formblock blocks in regions.
What I did though was put a block in a Views footer by using the following code:

<?php
// 'story' is the name of the content type I'm getting the form for
$block = (object) module_invoke('formblock', 'block', 'view', 'story');
print theme('block', $block);
?>

What I wanted was for the block to use a block template, in which I surround the block with collapsible fieldsets, so that the block is hidden away. With the above code, normally you get all the right ids and classes for the div, so that you can use a block template like "block-formblock-story.tpl.php". But with formblock blocks i got something like <div class="block block-" id="block--"> instead of something like <div id="block-Unterlagen-0" class="block block-Unterlagen">.

So - I had to add two lines to formblock.module at line 100 (in function formblock_get_block), so that the function now looks like this:

<?php 
/**
 * Generate a block containing a node entry form.
 */
function formblock_get_block($type) {
  if (node_access('create', $type)) {
    // Include page handler for node_add()
    module_load_include('inc', 'node', 'node.pages');
    // Note title before rendering of form.
    $title = drupal_get_title();
    $form = node_add($type);
    $types = node_get_types('names');
    // Restore title, which will have been overridden.
    drupal_set_title($title);
    return array(
      'subject' => t('@type form', array('@type' => $types[$type])),
      'content' => $form,
// ADDED THESE TWO LINES TO GET CORRECT ID AND CLASS
      'module' => $types[$type],
      'delta' => 0,
    );
  }
}
?>

It gave me an ID for my block (slightly different than the usual "block-formblock-story" it was now "block-story-0"). I now have this awesome collapsed node/add form in a block underneath a view of nodes. Together with a small custom module I made (see this issue) people on my site can now create and view nodes on one page without having to click around so much.

Comments

Makku01’s picture

Category: bug » feature

Marked this as a feature request since I ran into the same issue.

mikey_p’s picture

Status: Active » Closed (outdated)

Closing out old 6.x issues.