Skip to content
Snippets Groups Projects
Commit 1d1bf33c authored by Daniel Cothran's avatar Daniel Cothran
Browse files

Issue #3466764 by andileco, nikathone: Add prefix to $set_label to prevent...

Issue #3466764 by andileco, nikathone: Add prefix to $set_label to prevent numbers being stripped by Html::cleanCssIdentifier
parent 3413980c
No related branches found
No related tags found
1 merge request!109Resolve #3466764 "Add prefix to"
Pipeline #248182 passed with warnings
......@@ -6,7 +6,7 @@
*/
use Drupal\charts\ConfigUpdater;
use Drupal\Core\Serialization\Yaml;
use Drupal\Component\Serialization\Yaml;
/**
* Initialize advanced requirements cdn config value.
......
......@@ -2,12 +2,12 @@
namespace Drupal\charts;
use Drupal\Component\Serialization\Yaml;
use Drupal\Component\Utility\Color;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Extension\ModuleExtensionList;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Serialization\Yaml;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
......
......@@ -5,12 +5,12 @@ namespace Drupal\charts\Form;
use Drupal\charts\ChartManager;
use Drupal\charts\DependenciesCalculatorTrait;
use Drupal\charts\TypeManager;
use Drupal\Component\Serialization\Yaml;
use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Extension\ModuleExtensionList;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Serialization\Yaml;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
......
......@@ -742,7 +742,9 @@ class ChartsPluginStyleChart extends StylePluginBase implements ContainerFactory
$element_key_prefix = $this->view->current_display . '__' . $label_field_key;
$chart_settings = $this->options['chart_settings'];
foreach ($sets as $set_label => $data_set) {
$name = strtolower(Html::cleanCssIdentifier($set_label));
$name = strtolower(Html::cleanCssIdentifier('set-label-' . $set_label));
// Remove the added prefix after processing.
$name = substr($name, strlen('set-label-'));
$element_key = $element_key_prefix . '__' . $name;
$chart[$element_key] = [
'#type' => 'chart_data',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment