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

Shows the real path of the views in the QueryCollector #1345

Closed
wants to merge 3 commits into from

Conversation

SudoGetBeer
Copy link
Contributor

Hey,

really loving this package.
Recently I tried to debug a n+1 query but it was triggered in a view. But the debugbar only showed the path of the compiled version.
It uses the PATH ENDPATH logic added to the end of the compiled view. That was added in 5.8. ( laravel/framework#28117 ).

The regex logic is the same Nuno used in this PR. laravel/framework#44347

@barryvdh
Copy link
Owner

I think it is supposed to show the original path already. I'm okay with the endpath, but for other compilers this would not work.

@barryvdh
Copy link
Owner

Is this still relevant?

@erikn69
Copy link
Contributor

erikn69 commented Feb 20, 2024

Is this still relevant?

@barryvdh no, but the test YES

after the fixes that I added, you now have access to the real files instead of the compiled ones
Due to the previous functionality backtrack trace is displayed like this view::home, middleware::db, but on query info the real file is displayed
image
image

Since it is only the trace, it may not be important to show the real file

To show the real path instead, You should give priority to the file property, but this would be in maximebf/php-debugbar

maximebf/php-debugbar/src/DebugBar/Resources/widgets/sqlqueries/widget.js#L61-L62

-   .concat(value.namespace ? [value.namespace + '::'] : [])
+   .concat(!value.file && value.namespace ? [value.namespace + '::'] : [])
-   .concat([value.name || value.file])
+   .concat([value.file || value.name])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants