Skip to content

Commit c5d8eda

Browse files
authored
[4.0] Fix the debug plugin on error page
Correcting an event when an assets need to be used.
1 parent a9e48fa commit c5d8eda

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

plugins/system/debug/debug.php

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -177,17 +177,34 @@ public function __construct(&$subject, $config)
177177
&& $this->app->input->get('plugin') === 'debug' && $this->app->input->get('group') === 'system';
178178

179179
$this->showLogs = (bool) $this->params->get('logs', false);
180+
181+
// Log deprecated class aliases
182+
if ($this->showLogs && $this->app->get('log_deprecated'))
183+
{
184+
foreach (JLoader::getDeprecatedAliases() as $deprecation)
185+
{
186+
Log::add(
187+
sprintf(
188+
'%1$s has been aliased to %2$s and the former class name is deprecated. The alias will be removed in %3$s.',
189+
$deprecation['old'],
190+
$deprecation['new'],
191+
$deprecation['version']
192+
),
193+
Log::WARNING,
194+
'deprecation-notes'
195+
);
196+
}
197+
}
180198
}
181199

182200
/**
183-
* Add the CSS for debug.
184-
* We can't do this in the constructor because stuff breaks.
201+
* Add an assets for debugger.
185202
*
186203
* @return void
187204
*
188-
* @since 2.5
205+
* @since __DEPLOY_VERSION__
189206
*/
190-
public function onAfterDispatch()
207+
public function onBeforeCompileHead()
191208
{
192209
// Only if debugging or language debug is enabled.
193210
if ((JDEBUG || $this->debugLang) && $this->isAuthorisedDisplayDebug() && $this->app->getDocument() instanceof HtmlDocument)
@@ -215,24 +232,6 @@ public function onAfterDispatch()
215232
{
216233
$this->app->getDocument()->setMediaVersion(null);
217234
}
218-
219-
// Log deprecated class aliases
220-
if ($this->showLogs && $this->app->get('log_deprecated'))
221-
{
222-
foreach (JLoader::getDeprecatedAliases() as $deprecation)
223-
{
224-
Log::add(
225-
sprintf(
226-
'%1$s has been aliased to %2$s and the former class name is deprecated. The alias will be removed in %3$s.',
227-
$deprecation['old'],
228-
$deprecation['new'],
229-
$deprecation['version']
230-
),
231-
Log::WARNING,
232-
'deprecation-notes'
233-
);
234-
}
235-
}
236235
}
237236

238237
/**

0 commit comments

Comments
 (0)