From 235a810e9040edc01cccf3e0a07a005b59ac58af Mon Sep 17 00:00:00 2001 From: Yahnis Elsts Date: Tue, 16 May 2017 21:16:08 +0300 Subject: [PATCH] Fix an issue with Debug Bar 0.9 where the content of some PUC panels was not visible. See issue #102. Cause: Debug Bar 0.9 now includes an admin bar menu that lists the available panels. This means that the special element that PUC uses to identify its panel titles () is no longer unique. This breaks the JS that's supposed to work around the fact that Debug Bar incorrectly assumes that every panel will have a unique PHP class name. --- Puc/v4p1/DebugBar/Extension.php | 2 +- Puc/v4p1/DebugBar/Panel.php | 2 +- js/debug-bar.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Puc/v4p1/DebugBar/Extension.php b/Puc/v4p1/DebugBar/Extension.php index d8ac427..8b50ce1 100644 --- a/Puc/v4p1/DebugBar/Extension.php +++ b/Puc/v4p1/DebugBar/Extension.php @@ -46,7 +46,7 @@ if ( !class_exists('Puc_v4p1_DebugBar_Extension', false) ): 'puc-debug-bar-js-v4', $this->getLibraryUrl("/js/debug-bar.js"), array('jquery'), - '20161219' + '20170516' ); } diff --git a/Puc/v4p1/DebugBar/Panel.php b/Puc/v4p1/DebugBar/Panel.php index c0a87c6..80812d0 100644 --- a/Puc/v4p1/DebugBar/Panel.php +++ b/Puc/v4p1/DebugBar/Panel.php @@ -11,7 +11,7 @@ if ( !class_exists('Puc_v4p1_DebugBar_Panel', false) && class_exists('Debug_Bar_ public function __construct($updateChecker) { $this->updateChecker = $updateChecker; $title = sprintf( - 'PUC (%s)', + 'PUC (%s)', esc_attr($this->updateChecker->getUniqueName('uid')), $this->updateChecker->slug ); diff --git a/js/debug-bar.js b/js/debug-bar.js index 57baaa9..b8435db 100644 --- a/js/debug-bar.js +++ b/js/debug-bar.js @@ -44,7 +44,7 @@ jQuery(function($) { target.attr('id', 'debug-menu-target-puc-' + uid); //Change the menu link ID as well and point it at the new target ID. - $('#puc-debug-menu-link-' + uid) + $('#debug-bar-menu').find('.puc-debug-menu-link-' + uid) .closest('.debug-menu-link') .attr('id', 'debug-menu-link-puc-' + uid) .attr('href', '#' + target.attr('id'));