Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If an internal PHP function, such as call_user_func, in the backtrace, the 'file' and 'line' not be available. #528

Merged
merged 8 commits into from
Dec 4, 2023
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Yii Framework 2 debug extension Change Log
2.1.26 under development
------------------------

- no changes in this release.
- Bug #528: Fix the backtrace, the 'file' and 'line' not be available (zymeli)
zymeli marked this conversation as resolved.
Show resolved Hide resolved


2.1.25 September 26, 2023
Expand Down
8 changes: 8 additions & 0 deletions src/Panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ public function getUrl($additionalParams = null)
*/
public function getTraceLine($options)
{
/**
* If an internal PHP function, such as `call_user_func`, in the backtrace, the 'file' and 'line' not be available.
* @see https://www.php.net/manual/en/function.debug-backtrace.php#59713
*/
if (!isset($options['file'])) {
return VarDumper::dumpAsString($options);
}

if (!isset($options['text'])) {
$options['text'] = "{$options['file']}:{$options['line']}";
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/default/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div id="yii-debug-toolbar" class="yii-debug-toolbar yii-debug-toolbar_position_top" style="display: none;">
<div class="yii-debug-toolbar__bar">
<div class="yii-debug-toolbar__block yii-debug-toolbar__title">
<a href="#">
<a href="<?= Url::to(['index']) ?>">
<img width="30" height="30" alt="" src="<?= \yii\debug\Module::getYiiLogo() ?>">
</a>
</div>
Expand Down
Loading