Skip to content

[VarDumper] HtmlDumper: fix collapsing nodes with depth < maxDepth #24747

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

Merged
merged 1 commit into from
Oct 29, 2017
Merged

[VarDumper] HtmlDumper: fix collapsing nodes with depth < maxDepth #24747

merged 1 commit into from
Oct 29, 2017

Conversation

ogizanagi
Copy link
Contributor

@ogizanagi ogizanagi commented Oct 29, 2017

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes (failures unrelated)
Fixed tickets N/A
License MIT
Doc PR N/A

This error happens since #23967:

(index):3 Uncaught TypeError: Cannot read property 'substr' of null

var r = doc.getElementById(a.getAttribute('href').substr(1)),

when trying to collapse the root node (or more precisely, the nodes with a depth <= maxDepth) because it misses one of the sf-dump-expanded/sf-dump-compact classes which are necessary for the toggling to work.

@ogizanagi ogizanagi changed the title [VarDumper] Fix collapsing nodes with depth < maxDepth [VarDumper] HtmlDumper: fix collapsing nodes with depth < maxDepth Oct 29, 2017
@ogizanagi ogizanagi added this to the 3.4 milestone Oct 29, 2017
@fabpot
Copy link
Member

fabpot commented Oct 29, 2017

Thank you @ogizanagi.

@fabpot fabpot merged commit a1863c3 into symfony:3.4 Oct 29, 2017
fabpot added a commit that referenced this pull request Oct 29, 2017
…maxDepth (ogizanagi)

This PR was merged into the 3.4 branch.

Discussion
----------

[VarDumper] HtmlDumper: fix collapsing nodes with depth < maxDepth

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes (failures unrelated)
| Fixed tickets | N/A <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

This error happens since #23967:

> (index):3 Uncaught TypeError: Cannot read property 'substr' of null

https://github.com/symfony/symfony/blob/98dae3edb1ba8fa35c06a8c9a459e0ffb9105826/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php#L325

when trying to collapse the root node (or more precisely, the nodes with a depth <= maxDepth) because it misses one of the `sf-dump-expanded`/`sf-dump-compact` classes which are necessary for the toggling to work.

Commits
-------

a1863c3 [VarDumper] HtmlDumper: fix collapsing nodes with depth <= maxDepth
@ogizanagi ogizanagi deleted the fix/3.4/var_dumper/html_dumper_root_node branch October 29, 2017 20:56
This was referenced Oct 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants