Skip to content
Snippets Groups Projects
Commit 13b1f4d8 authored by emanaton's avatar emanaton Committed by Nick Dickinson-Wilde
Browse files

Issue #3326133 by emanaton, NickDickinsonWilde: Add support for...

Issue #3326133 by emanaton, NickDickinsonWilde: Add support for single_content_sync module; color field is null on export
parent b424a8a7
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@
declare(strict_types = 1);
use Drupal\color_field\ColorHex;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Render\BubbleableMetadata;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
......@@ -201,3 +202,18 @@ function color_field_tokens(string $type, array $tokens, array $data, array $opt
return $replacements;
}
/**
* Implements hook_content_export_field_value_alter().
*
* Include the color_field in exports by the single_content_sync module.
*/
function color_field_content_export_field_value_alter(mixed &$value, FieldItemListInterface $field): void {
switch ($field->getFieldDefinition()->getType()) {
case 'color_field_type':
$value[] = [
'color' => $field->color,
];
break;
}
}
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