Problem/Motivation

Currently, when more than one Charts submodule (e.g. Highcharts) is saved, users should select which library is the default in the "Chart configuration" page (/admin/config/content/charts). This adds a horizontal tab on that page with additional settings that are specific to that library. In the case of Highcharts, that includes language options like what a thousands separator should be.

If a user decides to switch which library is the default, then those settings are lost. I happen to do this a lot in order to see how each of the libraries looks on the page generated by the Charts API Example module (/charts/example/display). This can be extremely frustrating, especially now that the Highcharts module has settings for additional libraries that can be included.

Steps to reproduce

  1. Enable the Highcharts and Chart.js modules.
  2. Navigate to /admin/config/content/chart
  3. Set Highcharts as the default library, then check "Enable Highcharts' "Accessibility" library" in the "Highcharts settings" horizontal tab.
  4. Save.
  5. Set Chart.js as the default library.
  6. Save.
  7. Set Highcharts as the default library and check the "Highcharts settings" horizontal tab: the Accessibility library will be unchecked.

Proposed resolution

Add a new library_configs setting that can hold the per-library configuration information and use this instead of the single shared library_config (no s); in this way, switching between libraries no longer discards the other library's configuration.

Remaining tasks

Manual user testing and confirmation that the fix works.

User interface changes

None.

API changes

Data model changes

Issue fork charts-3532462

Command icon 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

andileco created an issue. See original summary.

nikathone made their first commit to this issue’s fork.

andileco’s picture

Version: 5.1.x-dev » 5.2.x-dev

andileco changed the visibility of the branch 5.2.x to hidden.

andileco changed the visibility of the branch 5.1.x to hidden.

andileco changed the visibility of the branch 3532462-prevent-library-specific-default to hidden.

andileco’s picture

Issue summary: View changes
andileco’s picture

Status: Active » Needs review
nikathone’s picture

Status: Needs review » Reviewed & tested by the community

  • andileco committed e640f345 on 5.2.x
    feat: #3532462 Prevent library-specific default configurations from...
andileco’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.