-
Notifications
You must be signed in to change notification settings - Fork 4
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
Arguments not populated. #11
Comments
Can you open a PR? |
Hopefully that's okay. |
Thanks for your submission, but I cannot reproduce your issue. I've coded a quick POC in https://3v4l.org/270Fa and I see no difference with your proposed implementation in #12 . What IDE are you using to debug the template? Can you post two images to illustrate the problem with the debugger, before and after your proposed change? |
Here is my setup and version info:
There has been an issue raised on Drupal.org regarding $arguments not being populated. The issue also mentions issues with non-population of other array elements in $context but I cannot reproduce that. Link to the issue: https://www.drupal.org/project/twig_xdebug/issues/2973341 Out of the box and adding {{ breakpoint("Test") }} to a template, I see: With the proposed change and adding {{ breakpoint("Test") }} to a template, I see: If I set an intermediate variable ($func_get_args_output = func_get_args();) rather than overwriting the $arguments variable, I see this: When func_get_args() is used directly as an argument for the array_slice function, $arguments doesn't show in the variables list. I was wondering if it was a PHP version issue but your POC seems to have that covered. I've also tested with PHP 7.2.10 and Xdebug 2.7.0beta1 with the same result. |
Thanks for the detailed info. I've been able to reproduce the issue with:
I'm not sure where is the issue originated, but I'll approve the PR to solve it |
Thanks for the quick turnaround all! This will be released on the Drupal side shortly. |
I'm not seeing the $arguments variable being populated. The issue is with the setBreakpoint method in the BreakpointExtension class in src/BreakpointExtension.php.
It works if I replace this:
$arguments = array_slice($ func_get_args(), 2);
with
$arguments = func_get_args();
$arguments = array_slice($arguments, 2);
The text was updated successfully, but these errors were encountered: