Problem/Motivation
* Charting library: Highcharts
* A chart is not attached to a page on the first load:
Uncaught TypeError: $(...).once is not a function due to https://www.drupal.org/node/3158256
Steps to reproduce
1. Create a chart
2. Add to a page
3. The chart is not displayed when the page is loaded first time. There is the above mentioned error in the console as well.
Proposed resolution
Deprecate jquery.once and use the new core/once library instead.
Need to follow steps from
* https://www.drupal.org/node/3158256
* https://www.drupal.org/docs/drupal-apis/javascript-api/javascript-api-ov...
Remaining tasks
Needs review
User interface changes
No
API changes
No
Data model changes
No
| Comment | File | Size | Author |
|---|
Issue fork charts-3261881
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
tatianag commentedComment #4
tatianag commentedComment #5
andileco commentedThank you for creating this ticket with good documentation and for providing a solution! Would you be willing to solve this for the other libraries included in the charts module (charts_c3, charts_billboard, charts_google, charts_chartjs)? That will make it easier for me to just accept the merge request.
Comment #8
andileco commentedThanks so much for getting this started and for @nikathone contributing code for charts_chartjs and charts_google.
Comment #12
xurizaemonAttaching a copy of MR !17 as of b166f036 as Gitlab MR URLs are subject to unexpected changes (ref #3204538).
Comment #13
liquidcms commentedI have 5-dev from last week and still getting this error. But oddly it works on my local (windows) and client's MAC; but not on server (centos).
my guess is this fix hasnt actually made it in to the code.. will check and re-test.
Comment #14
liquidcms commenteda bit hard to tell from these commits what the actual fix is; but i dont think these changes have made it to latest 5.0.x-dev. Comparing the code pretty sure not there.
Comment #15
andileco commentedThis has definitely been fixed - see: https://git.drupalcode.org/project/charts/-/blob/5.0.x/modules/charts_hi... as an example.
Comment #16
liquidcms commentedAfter getting latest -dev release i get the class error reported here: #3274100: Symphony class not found.. After fixing that i get this "once" issue. Guessing now the problem is that 5.x is not compatible with D8. Will try reverting back to an older release.
Part of the confusion is Charts is listed as: core_version_requirement: ^8 || ^9, but those core changes are D9 only.
Comment #17
liquidcms commentedMy issue is with Google charts.
Comment #18
xurizaemonOpened #3274356: update module requirements to 9.2+ to signal new requirements @liquidcms. Thanks for reporting!