Skip to content

[Issue] Fix table render of DiInfoCommand #38820

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

Open
m2-assistant bot opened this issue Jun 11, 2024 · 5 comments
Open

[Issue] Fix table render of DiInfoCommand #38820

m2-assistant bot opened this issue Jun 11, 2024 · 5 comments
Labels
Area: Framework Component: Console Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: ready for confirmation Priority: P3 May be fixed according to the position in the backlog. Progress: ready for dev Reported on 2.4.7 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@m2-assistant
Copy link

m2-assistant bot commented Jun 11, 2024

This issue is automatically created based on existing pull request: #38813: Fix table render of DiInfoCommand


When running the DiInfoCommand under Magento 2.4.7 and PHP 8.3, line 96 mentions to pass the output of $paramsTable->render() to the $output. However, because of typing issues, this causes a Fatal Error. According the Symfony docs (since a long time) the render() method is already giving output, so the output should not be passed to $output->writeln() anyway. This PR fixes things.

@m2-community-project m2-community-project bot added Issue: ready for confirmation Priority: P3 May be fixed according to the position in the backlog. labels Jun 11, 2024
@engcom-Dash engcom-Dash added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Jun 11, 2024
@engcom-November engcom-November self-assigned this Jun 12, 2024
Copy link
Author

m2-assistant bot commented Jun 12, 2024

Hi @engcom-November. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-November
Copy link
Contributor

Hello @jissereitsma,

Thank you for the report and collaboration!

Verified this on 2.4-develop with php 8.3.
When running bin/magento dev:di:info "<class-namespace>" we are getting below error:

There is an error in /opt/homebrew/var/www/magento8/vendor/symfony/console/Output/Output.php at line: 109
Symfony\Component\Console\Output\Output::writeln(): Argument #1 ($messages) must be of type Traversable|array|string, null given, called in /opt/homebrew/var/www/magento8/app/code/Magento/Developer/Console/Command/DiInfoCommand.php on line 96#0 /opt/homebrew/var/www/magento8/app/code/Magento/Developer/Console/Command/DiInfoCommand.php(96): Symfony\Component\Console\Output\Output->writeln(NULL)
#1 /opt/homebrew/var/www/magento8/app/code/Magento/Developer/Console/Command/DiInfoCommand.php(167): Magento\Developer\Console\Command\DiInfoCommand->printConstructorArguments('Magento\\Quote\\M...', Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /opt/homebrew/var/www/magento8/vendor/symfony/console/Command/Command.php(326): Magento\Developer\Console\Command\DiInfoCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /opt/homebrew/var/www/magento8/lib/internal/Magento/Framework/Interception/Interceptor.php(58): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /opt/homebrew/var/www/magento8/lib/internal/Magento/Framework/Interception/Interceptor.php(138): Magento\Developer\Console\Command\DiInfoCommand\Interceptor->___callParent('run', Array)
#5 /opt/homebrew/var/www/magento8/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Developer\Console\Command\DiInfoCommand\Interceptor->Magento\Framework\Interception\{closure}(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /opt/homebrew/var/www/magento8/generated/code/Magento/Developer/Console/Command/DiInfoCommand/Interceptor.php(77): Magento\Developer\Console\Command\DiInfoCommand\Interceptor->___callPlugins('run', Array, Array)
#7 /opt/homebrew/var/www/magento8/vendor/symfony/console/Application.php(1078): Magento\Developer\Console\Command\DiInfoCommand\Interceptor->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /opt/homebrew/var/www/magento8/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand(Object(Magento\Developer\Console\Command\DiInfoCommand\Interceptor), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /opt/homebrew/var/www/magento8/lib/internal/Magento/Framework/Console/Cli.php(118): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /opt/homebrew/var/www/magento8/vendor/symfony/console/Application.php(175): Magento\Framework\Console\Cli->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /opt/homebrew/var/www/magento8/bin/magento(23): Symfony\Component\Console\Application->run()
#12 {main}

This is due to the parameter being passed to Output::writeln should be of Traversable|array|string.
Since the render() function renders the output by default there is no need to pass it to Output::writeln.

Note: There is a render function being passed to Output::writeln in line number 145 as well. it would be great if you could remove Output::writeln in line 145.

Hence confirming the issue.

Thank you.

@engcom-November engcom-November added Component: Console Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Area: Framework Reported on 2.4.7 Indicates original Magento version for the Issue report. Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Jun 12, 2024
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-12120 is successfully created for this GitHub issue.

Copy link
Author

m2-assistant bot commented Jun 12, 2024

✅ Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@hostep
Copy link
Contributor

hostep commented Jun 27, 2024

This one can be closed as it duplicates #38740

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Framework Component: Console Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: ready for confirmation Priority: P3 May be fixed according to the position in the backlog. Progress: ready for dev Reported on 2.4.7 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants