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

drillUp. Cannot set property 'length' of undefined #8324

Closed
balkarov opened this issue May 11, 2018 · 9 comments · Fixed by #17224
Closed

drillUp. Cannot set property 'length' of undefined #8324

balkarov opened this issue May 11, 2018 · 9 comments · Fixed by #17224
Assignees

Comments

@balkarov
Copy link

Cannot set property 'length' of undefined when call drillUp() after chart.applyDrilldown();
Screenshot:
error

Expected behaviour

Not error

Actual behaviour

Error

Live demo with steps to reproduce

https://jsfiddle.net/jus3gc2n/

Product version

Highcharts version 6.1.0

Affected browser(s)

Chrome 66.0.3359.139

@sebastianbochan
Copy link
Contributor

sebastianbochan commented May 14, 2018

Hi @balkarov,
Thank you for the reporting. The issue is caused by missing ddDupes in the chart object. The solution is call point.doDrilldown() before applyDrilldown.

Demo:

Internal note
Should we add doDrilldown() in applyDrilldown() ?

@muodov
Copy link

muodov commented Dec 28, 2018

Calling doDrilldown() triggers the drilldown event, which kinda breaks the async drilldown flow.

Normal async flow:

  1. user click triggers drilldown event
  2. event listener starts some async work and eventually calls addSeriesAsDrilldown()
  3. addSeriesAsDrilldown() calls addSingleSeriesAsDrilldown() and applyDrilldown() but doesn't call doDrilldown() to avoid another drilldown event.

Programmatic flow (as suggested above):

  1. call addSingleSeriesAsDrilldown(), applyDrilldown() and doDrilldown() to fix the exception, which will also trigger drilldown event as a side-effect.

Now, if I need to support both programmatic and user-click events, it becomes annoying because I will have to cancel the next drilldown event handler after a programmatic drilldown.

I looked through the code, and I believe the absence of ddDupes is just a mistake introduced in ada67c7#diff-1d9d9d6b74edd8331bf8f425ab1d7f42. It specifically handled this situation in doDrilldown() but not in drillUp(). Before that change "dupes" were always initialized: see the original fix here b633bb9

So, it feels like calling doDrilldown() is a bit of an overkill with unnecessary side effects. Why not just add a check in drillUp() similar to https://github.com/highcharts/highcharts/blob/master/js/modules/drilldown.src.js#L1087?

Or, maybe just initialize ddDupes in constructor and clear it inside destroy() to keep #3990 fixed?

@muodov
Copy link

muodov commented Dec 28, 2018

As a workaround, I'm currently just adding these lines after a programmatic drilldown:

if (!chart.ddDupes) { // https://github.com/highcharts/highcharts/issues/8324
   chart.ddDupes = [];
}

@stale
Copy link

stale bot commented Jun 28, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions!

@stale stale bot added the Status: Stale This issue hasn't had any activity for a while, and will be auto-closed if no further updates occur. label Jun 28, 2020
@stale stale bot closed this as completed Jul 5, 2020
@balkarov
Copy link
Author

balkarov commented Jul 5, 2020

Hello. Why you close this issue? Did you fix it? What’s the release?

@sebastianbochan
Copy link
Contributor

sebastianbochan commented Jul 6, 2020

Hi @balkarov,
I apologize for inconvenience. We use auto-closer bot for the oldest issues. Im reopening the issue.

@stale stale bot removed the Status: Stale This issue hasn't had any activity for a while, and will be auto-closed if no further updates occur. label Jul 6, 2020
@highsoft-bot highsoft-bot added Status: Stale This issue hasn't had any activity for a while, and will be auto-closed if no further updates occur. and removed Status: Done labels Jul 6, 2020
@stale stale bot removed the Status: Stale This issue hasn't had any activity for a while, and will be auto-closed if no further updates occur. label Jul 6, 2020
@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions!

@stale stale bot added the Status: Stale This issue hasn't had any activity for a while, and will be auto-closed if no further updates occur. label Apr 17, 2022
@balkarov
Copy link
Author

Hello. Why you close this issue? Did you fix it? What’s the release?

@stale stale bot removed the Status: Stale This issue hasn't had any activity for a while, and will be auto-closed if no further updates occur. label Apr 17, 2022
@pawellysy
Copy link
Member

Hello @balkarov, This issue is still not fixed. The stale bot marks the issues, which are inactive for a long period of time as stale, and then closes them due to the inactivity. I will move this issue to the inbox so that it will be prioritized. Sorry for the inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants