Skip to content
Snippets Groups Projects
Commit cbb2d01a authored by d.clarke's avatar d.clarke Committed by NGUYEN Bao
Browse files

Issue #3387807 by d.clarke: HTML 5 data-* attributes fix for case sensitive variable names

parent b9664c26
No related branches found
No related tags found
No related merge requests found
......@@ -3,11 +3,11 @@
namespace Drupal\sign_widget\Plugin\Field\FieldWidget;
use Drupal\Component\Render\PlainTextOutput;
use Drupal\Component\Utility\Html;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Component\Utility\Html;
use Drupal\Core\Template\Attribute;
use Drupal\file\Entity\File;
use Drupal\image\Plugin\Field\FieldWidget\ImageWidget;
......@@ -229,7 +229,7 @@ class SignWidget extends ImageWidget {
'class' => ["signature-pad", "border"],
]);
foreach ($this->settings as $attribute => $settingValue) {
$attributes['data-' . $attribute] = $settingValue;
$attributes['data-' . strtolower(preg_replace('/([a-zA-Z])(?=[A-Z])/', '$1-', $attribute))] = $settingValue;
}
$sign_pad = [
'#theme' => 'sign',
......
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