# HG changeset patch # User Franck Deroche # Date 1293801217 -3600 # Node ID 85e281a44a62de58b6616ee643f81febf7dd5e3d # Parent e02de6b2566ee992119b05fc459ee54dde764210 Refuse to add popups.js to an ajax request that's not already a popup In some case, if you enable the "Always scan for popups links" options, Popups Ajax processing will break the original module request. diff -r e02de6b2566e -r 85e281a44a62 popups.module --- a/popups.module Fri Dec 31 14:07:33 2010 +0100 +++ b/popups.module Fri Dec 31 14:13:37 2010 +0100 @@ -291,6 +291,10 @@ */ function popups_add_popups($rules=NULL) { static $added = FALSE; + static $shouldAdd = NULL; + if (is_null($shouldAdd)) { + $shouldAdd = !isset($_SERVER['HTTP_X_REQUESTED_WITH']) || $_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest' || $_SESSION['page_override']; + } $settings = array('popups' => array()); if (is_array($rules)) { @@ -307,7 +311,7 @@ drupal_add_js( $settings, 'setting' ); } } - if (!$added) { + if (!$added && $shouldAdd) { // Determing if we are showing the default theme or a custom theme. global $custom_theme; $theme = $custom_theme;