Project:Popups API (Ajax Dialogs)
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:starbow
Status:closed (fixed)

Issue Summary

If your site uses an administration theme, you can only set up blocks for the administration theme.

Steps to reproduce :
- set an administration theme
- set the "Scan all pages for popup links" option
- try to change the order of blocks for your main theme - the changes get applied to the admin theme.

Bottom line is that theme() calls in hook_init() break the block settings page, which relies on a theme switch done in the page callback. But if a module triggers init_theme() before that (in our case, calls to popups_add_popups() in popups_init()), this theme switch breaks.

Marking as critical, although I'm a little surprise to find no other reports - so maybe I'm missing something ?

Comments

#1

edit :
step 2 - set the "Scan all pages for popup links" option *or simply enable popups_admin*

#2

Assigned to:Anonymous» starbow

*Wham* - the sound of me whacking my palm to my forehead.
Definitely a critical bug, one that has been driving me nuts, and all this time I have just been assuming it was a Drupal 6 core issue :)
Thanks for pointing it out. Now I just need to figure out how to fix it. I might just have to disable popup functionality for the blocks management pages.
Just shows one of the limitations of the hook_init trick. More motivation to get something cleaner into d7.

#3

Status:active» needs review

Actually it is my approach that needs review. Since I cannot call theme in popups_init, I need to remove the theme('popups_popup') call from popups_add_popups(). So how do I get the popup template to popup.js? In Drupal 5 I could have called drupal_set_js in popups_footer, but that no longer works in Drupal 6.

My current thought is to use setrawcookie in popups_footer to pass the template. This works, but it somehow seems undrupalish.

#4

Status:needs review» fixed

Ok, I moved the popup html into popups.js, so the theme call is no longer needed in popups_add_popups.

#5

It is checked into dev and will be part of 1.2-alpha2

#6

Status:fixed» closed (fixed)

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