8000 [Console] Cannot set header title without headers row · Issue #42196 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Console] Cannot set header title without headers row #42196

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

Closed
a-menshchikov opened this issue Jul 19, 2021 · 1 comment
Closed

[Console] Cannot set header title without headers row #42196

a-menshchikov opened this issue Jul 19, 2021 · 1 comment

Comments

@a-menshchikov
Copy link
Contributor

Symfony version(s) affected: 5.3.3

Description
If headers row doesn't present in a Table, the setHeaderTitle call doesn't work.

How to reproduce

(new Table($output))
    ->setHeaderTitle('Reproducer')
    ->setRows([
        ['Value', '123-456'],
        ['Some other value', '789-0'],
    ])
    ->render()
;

renders

+------------------+---------+
| Value            | 123-456 |
| Some other value | 789-0   |
+------------------+---------+

But

(new Table($output))
    ->setHeaderTitle('Reproducer')
    ->setHeaders(['Key', 'Value'])
    ->setRows([
        ['Value', '123-456'],
        ['Some other value', '789-0'],
    ])
    ->render()
;

renders

+-------- Reproducer --------+
| Key              | Value   |
+------------------+---------+
| Value            | 123-456 |
| Some other value | 789-0   |
+------------------+---------+
chalasr added a commit that referenced this issue Jul 21, 2021
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Console] fix table setHeaderTitle without headers

| Q             | A
| ------------- | ---
| Branch?       | 4.4 , 5.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #42196
| License       | MIT
| Doc PR        |

fix bug

Commits
-------

e4a0c5d [Console] fix table setHeaderTitle without headers
@a1812
Copy link
Contributor
a1812 commented Jul 21, 2021

it can be closed

@chalasr chalasr closed this as completed Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0