Warning: Undefined array key "library" in Drupal\charts\Element\BaseSettings::processSettings()...line 125...\BaseSettings.php

Created on 9 February 2022, almost 3 years ago
Updated 20 June 2023, over 1 year ago

Problem

Install, set default settings for charts. php8.1

Warning: Undefined array key "library" in Drupal\charts\Element\BaseSettings::processSettings() (line 125 of C:\xampp\htdocs\*\web\modules\contrib\charts\src\Element\BaseSettings.php)

πŸ› Bug report
Status

Fixed

Version

5.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States crutch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡΅πŸ‡°Pakistan hmdnawaz

    Yes, I re-installed the module and went to the /admin/config/content/charts and saved and clear the caches.

    Still, I'm getting this error.

    On /admin/config/content/charts, I do not see any field related to the library.

    In web/modules/contrib/charts/src/Element/BaseSettings.php, I printed the $element variable and I see this

    The library value is empty.

  • πŸ‡¨πŸ‡¦Canada nikathone Ontario

    @hmdnawaz here is an obvious question but I think I ask to get make sure that you did enable at least one of the charts library module? Also can you, please, let us know at what line in web/modules/contrib/charts/src/Element/BaseSettings.php you printed the $element?

    Thank you in advance for providing more information about this issue.

  • πŸ‡΅πŸ‡°Pakistan hmdnawaz

    Yes I enabled the highcharts module.

    I printed the $element variable just before this if statement. Line # 125

    if (!empty($element['#library']) && isset($library_options[$element['#library']])) {

    Also when I go to the the charts settings page, I don't see the highchart settings there.

  • Status changed to Needs review over 1 year ago
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    10 pass
  • πŸ‡ΊπŸ‡ΈUnited States andileco

    Sorry for the delay on this, it took a while to figure out how to replicate it. I think this patch should solve the issue. But let's make sure the tests pass.

  • Status changed to Fixed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States andileco

    Fixed. @hmdnawaz you will need to save the form at /admin/config/content/charts before you will see the Highcharts Settings as one of the horizontal tabs.

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

Production build 0.71.5 2024