yii2-debug icon indicating copy to clipboard operation
yii2-debug copied to clipboard

Missed debug bar when enablePrettyUrl is true

Open alexantr opened this issue 7 years ago • 3 comments

Install basic template with yii2-debug 2.0.14 and uncomment urlManager config in web.php.

You will see no button in right bottom corner:

gnjwoia

When enablePrettyUrl is false:

ull7fy1

Additional info

Q A
Yii version 2.0.15.1
PHP version 7.2.3
Operating system Windows 10 1803
yii2-debug 2.0.14

alexantr avatar Sep 27 '18 14:09 alexantr

I forgot to add .htaccess file in basic template. Now it's working here.

But I have another problem. I'm using suffix / in my projects and forcing redirects to URLs with slash in .htaccess:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9A-Za-z_/-]*[0-9A-Za-z_-])$ $1/ [R=301,L]

My urlManager config:

'urlManager' => [
    'enablePrettyUrl' => true,
    'showScriptName' => false,
    'suffix' => '/',
    'normalizer' => [
        'class' => 'yii\web\UrlNormalizer',
        'action' => 302,
    ],
    'rules' => [
    ],
],

Version 2.0.13 generates URL with suffix in panel:

<div id="yii-debug-toolbar" data-url="/debug/default/toolbar/?tag=5bae0a9310328" style="display:none" class="yii-debug-toolbar-bottom"></div>

Now it always generates URL without suffix:

<div id="yii-debug-toolbar" data-url="/debug/default/toolbar?tag=5bae0a9310328" style="display:none" class="yii-debug-toolbar-bottom"></div>

Browser catches too many redirects and doesn't show panel.

Broken after #302

alexantr avatar Sep 28 '18 11:09 alexantr

https://github.com/yiisoft/yii2-debug/issues/333?

samdark avatar Sep 28 '18 12:09 samdark

I have no probles with that config and disabled rule in .htaccess Maybe I need just to change my RewriteRule Or have ability to change suffix in extension rules

alexantr avatar Sep 28 '18 13:09 alexantr