php-debugbar icon indicating copy to clipboard operation
php-debugbar copied to clipboard

Conflict when var-dumper is used outside debugbar

Open prudloff-insite opened this issue 3 years ago • 0 comments

When using var-dumper first inside a debugbar collector then outside, it breaks the outside instance (clicking on an object or array does not collapse it). That's because DebugBarHtmlDumper::getDumpHeaderByDebugBar() replaces some CSS selectors, then when the "normal" var-dumper is called it does not dump the header again because it detects that it has already been dumped.

So only the prefixed version is dumped and the other var-dumper does not have any non-prefixed version to work with.

As a workaround, we extended DebugBarHtmlDumper to not prefix the CSS selectors. But I think a cleaner solution would to have a dumper option to disable prefixing.

prudloff-insite avatar Mar 17 '21 14:03 prudloff-insite