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)

Comments

crutch created an issue. See original summary.

crutch’s picture

Status: Active » Closed (works as designed)

Sorry, this was because no library was installed yet.

hmdnawaz’s picture

Status: Closed (works as designed) » Active

I have the library installed. But I am still getting this error when try to save the graph block in the layout builder.

andileco’s picture

@hmdnawaz, can you make sure you've saved this page (/admin/config/content/charts), clear caches, and then see if you still have an error?

hmdnawaz’s picture

StatusFileSize
new178.38 KB

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

dump

The library value is empty.

nikathone’s picture

@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.

hmdnawaz’s picture

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.

andileco’s picture

Status: Active » Needs review
StatusFileSize
new811 bytes

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.

  • andileco committed 239758b4 on 5.0.x
    Issue #3263413 by andileco, hmdnawaz, crutch, nikathone: Warning:...
andileco’s picture

Status: Needs review » Fixed

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.

Status: Fixed » Closed (fixed)

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