Hi,

I just installed the module, activated the block pop up module and activated the checkbox for a block to show it in a popup. Since then I get a WSOD showing the above error message.

Best,
Tobias

Comments

Road Kill’s picture

Yip get the same WSOD. I applied it to a block and it just dies.

hackvier’s picture

subscribing

m-si’s picture

subscribing

Josephnewyork’s picture

Me too... subscribing

Josephnewyork’s picture

Status: Active » Needs review

OK, here is the deal. The popup_block_preprocess_block() is being fired before the popup.api.inc is loaded.

To fix:

At: popup/modules/popup_block/popup_block.module:87

Add:

 if(!function_exists('popup_element'))
	    module_load_include('inc', 'popup', 'includes/popup.api'); 

Right before popup_element() is called.

This will make sure this doesn't happen again.

michaelsilverman’s picture

Joe - thanks for the fix just started to use this module and after receiving the error found and installed this patch. All seem to be going well.

Creators.guru’s picture

Title: Fatal error: Call to undefined function popup_element() in ...\popup\modules\popup_block\popup_block.module on line 87 » thanks bhaji

thanks for helping

can you refer me some other cool modules for creating better website

ari-meetai’s picture

Status: Needs review » Reviewed & tested by the community

This works as stated. It can be committed.

sdsheridan’s picture

Title: thanks bhaji » Fatal error: Call to undefined function popup_element() in ...\popup\modules\popup_block\popup_block.module on line 87
Status: Reviewed & tested by the community » Needs work

Changing title back, as "thanks bhaji" isn't too helpful in finding issues...

Also, a better fix would be to include the line

  module_load_include('inc', 'popup', 'includes/popup.api');

at the beginning of the function, as we know we'll need it anyway.

Shawn

msbjhandeer’s picture

Great help, it worked. thanx..

Rameez’s picture

Worked nicely. ... i wonder why it's not committed to stable release yet. thanks for help

Scheepers de Bruin’s picture

Thanks all, this'll be in the next release.

codigovision’s picture

I agree with others, this should be committed to the current release. I think it's important enough to constitute a 3.23 release. Thanks for the module.

pitxels’s picture

Also this breaks the hole site, should be critical, just saying

drummondf’s picture

Priority: Normal » Critical

I tried the fix in Comment #5 but then get this response:

Parse error: syntax error, unexpected '<' in /sites/all/modules/popup/modules/popup_block/popup_block.module on line 87

Please advise

michlis’s picture

Hi Eric,
Seems like you have included PHP opening tag, right? It's not needed and gives PHP error. Add just one line:

module_load_include('inc', 'popup', 'includes/popup.api');

at the beginning of function, so it will look like:

function popup_block_preprocess_block(&$variables){
  module_load_include('inc', 'popup', 'includes/popup.api');

  $settings = _popup_block_settings();
  $block = $variables['block'];
  $block_settings = $settings[$block->module.':'.$block->delta];

  if ($block_settings && $block_settings['active']){

    $attributes = array();

    $attributes['block'] = 1;
    $attributes['format'] = $block_settings['format'];
    $attributes['module'] = $block->module;
    $attributes['delta'] = $block->delta;

    $variables['block']->content = popup_element(
      $block->subject,
      $block->content,
      $attributes
    );
    $variables['block']->subject = '';
    
  }

}
drummondf’s picture

Status: Needs work » Fixed

Like a charm, thanks Michlis!

ATTN ALL w/ this issue: use solution #16

Status: Fixed » Closed (fixed)

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

Encarte’s picture

Status: Closed (fixed) » Active

To be fixed, this issue first needs a patch and then the patch must be reviewed and committed. Until then, the problem persists on the downloadable version and the solution in this issue is just a workaround.

Scheepers de Bruin’s picture

Status: Active » Closed (fixed)

Thanks all, fix in new release