Advanced Form Block Patching

kota's picture
Forums: 

Advanced Form Block was recently updated, and I had to patch this module again for associating tag-editing block with its belonging node.

The patch is:

Allow edit block based on current node

This time, patching was not straightforward as there was an error:

afb miura$ patch -p1 < 0001-allow-for-auto-detection-of-node.patch
patching file afb.module
Hunk #2 FAILED at 209.
Hunk #3 succeeded at 244 with fuzz 1 (offset 2 lines).
Hunk #4 succeeded at 683 with fuzz 2 (offset 7 lines).
Hunk #5 succeeded at 791 (offset 7 lines).
Hunk #6 succeeded at 814 (offset 7 lines).
1 out of 6 hunks FAILED -- saving rejects to file afb.module.rej

The rejected hunk was:

***************
*** 180,187 ****
   * Returns the page containing existing block list with block creation form.
   */
  function afb_admin_page() {
-   $output = render(drupal_get_form('afb_existing_blocks_display_form'));
-   $output .= render(drupal_get_form('afb_new_block_create_form'));

    return $output;
  }
--- 209,218 ----
   * Returns the page containing existing block list with block creation form.
   */
  function afb_admin_page() {
+   $form = drupal_get_form('afb_existing_blocks_display_form');
+   $output = render($form);
+   $form = drupal_get_form('afb_new_block_create_form');
+   $output .= render($form);

    return $output;
  }

and the current corresponding lines are

/**
 * Returns the page containing existing block list with block creation form.
 */
function afb_admin_page() {
  $output = array(
    'existing_blocks' => drupal_get_form('afb_existing_blocks_display_form'),
    'create_new_block' => drupal_get_form('afb_new_block_create_form'),
  );

  return $output;
}

As it seems to be OK with this, I left the rejected part as it is. The patch file is saved in the afb module root (biii_info/sites/default/modules/contrib/afb/).