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

JS error when clicking "Add new Category" before categories have loaded #11279

Closed
pento opened this issue Oct 31, 2018 · 1 comment
Closed

JS error when clicking "Add new Category" before categories have loaded #11279

pento opened this issue Oct 31, 2018 · 1 comment
Assignees
Labels
[Package] Editor /packages/editor REST API Interaction Related to REST API [Type] Bug An existing feature does not function as intended
Milestone

Comments

@pento
Copy link
Member

pento commented Oct 31, 2018

Describe the bug

The following JS error occurs when clicking the "Add new Category" link before the categories have loaded.

hierarchical-term-selector.js:340 Uncaught TypeError: Cannot read property 'length' of null
    at HierarchicalTermSelector.render (hierarchical-term-selector.js:340)
    at finishClassComponent (react-dom.24169eaf.js:13771)
    at updateClassComponent (react-dom.24169eaf.js:13733)
    at beginWork (react-dom.24169eaf.js:14402)
    at performUnitOfWork (react-dom.24169eaf.js:16441)
    at workLoop (react-dom.24169eaf.js:16480)
    at HTMLUnknownElement.callCallback (react-dom.24169eaf.js:140)
    at Object.invokeGuardedCallbackDev (react-dom.24169eaf.js:178)
    at invokeGuardedCallback (react-dom.24169eaf.js:227)
    at replayUnitOfWork (react-dom.24169eaf.js:15888)

To Reproduce
Steps to reproduce the behaviour:

  1. Create a new post
  2. Expand the Categories panel
  3. Click the "Add new Category" link, before the categories have loaded.
  4. See error

I think the "Add new Category" link is supposed to be hidden until the categories have loaded, but after #10089, isRequestingTerms in HierarchicalTermSelector isn't being set while the terms are loading, so the link shows too early.

@pento pento added [Type] Bug An existing feature does not function as intended [Package] Editor /packages/editor labels Oct 31, 2018
@pento pento added this to the 4.2 milestone Oct 31, 2018
@danielbachhuber
Copy link
Member

Reloaded #6723

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Editor /packages/editor REST API Interaction Related to REST API [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants