Alters the paragraphs after conversion.
This hook is fired once per converted paragraph entity. The hook implementations must handle paragraphs translations on their own.
\Drupal\paragraphs\ParagraphInterface $original: The original paragraph entity.
\Drupal\paragraphs\ParagraphInterface $converted: The converted paragraph entity.
function hook_paragraphs_conversion_alter(ParagraphInterface $original, ParagraphInterface $converted) {
// Alter the converted text value.
if ($converted
->bundle() == 'text_image') {
$field_name = 'field_text_demo';
if ($converted
->hasField($field_name) && !$converted
->get($field_name)
->isEmpty()) {
$value = implode(', ', [
'New',
$converted
->get($field_name)->value,
]);
$converted
->set($field_name, $value);
}
}
}