ahah_helper_render doesn't include required page file properly

bpsommerville - June 3, 2009 - 05:09
Project:AHAH helper
Version:6.x-2.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:reviewed & tested by the community
Description

On line 145 of ahah_helper.module the ahah_helper_render function tries to include the page file that was referenced in the menu entry.
This fails because the require_once call uses form_state['storage']['#ahah_helper']['#file'] instead of form_state['storage']['#ahah_helper']['file']

Current code

  // $form_state['storage']['#ahah_helper']['file'] has been set, to know
  // which file should be loaded. This is necessary because we'll use the form
  // definition itself rather than the cached $form.
  if (isset($form_state['storage']['#ahah_helper']['file'])) {
    require_once($form_state['storage']['#ahah_helper']['#file']);
  }

Should be

  // $form_state['storage']['#ahah_helper']['file'] has been set, to know
  // which file should be loaded. This is necessary because we'll use the form
  // definition itself rather than the cached $form.
  if (isset($form_state['storage']['#ahah_helper']['file'])) {
    require_once($form_state['storage']['#ahah_helper']['file']);
  }

#1

svendecabooter - June 11, 2009 - 13:13

I encountered the same problem.
Attached a patch that fixes this.

AttachmentSize
ahah_helper-480472.patch 780 bytes

#2

Rok Žlender - August 19, 2009 - 21:34
Status:active» reviewed & tested by the community

Patch works fine for me.

#3

chaps2 - November 5, 2009 - 12:50

Patch works for me too.

#4

jefkin - November 5, 2009 - 13:24

I discovered this on my own, repaired as the patch does, and was about to report it when I found this! ... so patch works. More than 3 months now. push this one through!

 
 

Drupal is a registered trademark of Dries Buytaert.