lpa Posted August 28, 2021 Share Posted August 28, 2021 Hi When trying to use DumpsRecorderPanel, I get the following error: ErrorException: Array to string conversion in .../www/site/modules/TracyDebugger/tracy-2.8.x/src/Tracy/Helpers.php:80 What might be the reason for this? What can I do to further debug? Tracy version 4.22.11 and PW version 3.0.179. PHP 7.2.21 on MacOS. Link to comment Share on other sites More sharing options...
adrian Posted August 28, 2021 Share Posted August 28, 2021 Hi @lpa - I am not sure exactly, but it would be helpful if you could find out the value of $s on that line to figure out why it's an array instead of something that can be cast to a string. Also, are you trying to bd() anything in particular, or does the error show as soon as you load the panel? Link to comment Share on other sites More sharing options...
lpa Posted August 28, 2021 Author Share Posted August 28, 2021 The whole dump is like this: ErrorException: Array to string conversion in ../www/site/modules/TracyDebugger/tracy-2.8.x/src/Tracy/Helpers.php:80 Stack trace: #0 ../www/site/modules/TracyDebugger/tracy-2.8.x/src/Tracy/Helpers.php(80): Tracy\Bar->Tracy\{closure}(8, 'Array to string...', '/Users/lpa/www/...', 80, Array) #1 ../www/site/modules/TracyDebugger/panels/DumpsRecorderPanel.php(24): Tracy\Helpers::escapeHtml(Array) #2 ../www/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-2.8.x/src/Tracy/Bar/Bar.php(149): DumpsRecorderPanel->getTab() #3 ../www/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-2.8.x/src/Tracy/Bar/Bar.php(122): Tracy\Bar->renderPanels('') #4 ../www/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-2.8.x/src/Tracy/Bar/Bar.php(98): Tracy\Bar->renderHtml('main') #5 ../www/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-2.8.x/src/Tracy/Debugger/Debugger.php(313): Tracy\Bar->render() #6 [internal function]: Tracy\Debugger::shutdownHandler() #7 {main} I think it is now shown up as soon as the panel is loaded. How could I find out the $s value? Link to comment Share on other sites More sharing options...
adrian Posted August 28, 2021 Share Posted August 28, 2021 Thanks @lpa - that definitely helps. So now we can go back to line 24 of /site/modules/TracyDebugger/panels/DumpsRecorderPanel.php - for some reason $item['title'] is an array. Could you please place bd($items); between line 15 and 16 of that file and post a screenshot on the resulting dump (fully expanded). It should look something like this: except that those title keys will have an array as the value. Maybe by seeing what they are, we'll be able to figure out why it's happening in the first place. Link to comment Share on other sites More sharing options...
lpa Posted August 28, 2021 Author Share Posted August 28, 2021 Well, yes, it has over 300 items and some of those have array titles: How can I clean the cache of the DumpsRecorderPanel? Edit: Just found out how: removing the dumps.json in the TracyDebugger cache. Link to comment Share on other sites More sharing options...
adrian Posted August 28, 2021 Share Posted August 28, 2021 Thanks - still not sure how there ended up being arrays for the title, but maybe this was from an old version and you haven't cleaned up in a long time? The cache is in /site/assets/cache/TracyDebugger/dumps.json so you can delete that file. Keep in mind that in general you should use the "Clear Dumps" button within the panel itself when it is working again. Also, this is not a panel that you most likely want to leave on all the time and you should clear the dumps after your current debug needs. Link to comment Share on other sites More sharing options...
lpa Posted August 28, 2021 Author Share Posted August 28, 2021 I am using the DumpsRecorderPanel because I can't get the DumpsPanel showing up when trying to put bd() in PadLoper.module. What would be the reason when the Dumps Panel does not show up from a call in a module? Link to comment Share on other sites More sharing options...
adrian Posted August 28, 2021 Share Posted August 28, 2021 @lpa - typically bd() calls work fine in modules, but there a few reasons why the normal dumps panel may not work (I don't know specifically why it's not working with Padloper), which is one of the reasons why I built the "recorder" version to capture those. Also it is useful to compare dumps across multiple requests. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now