🇮🇳India akhilavnair Kerala
Hi Team,
Any fixes are going to be pushing for this issue, I'm getting same issue.
🇮🇳India akhilavnair Kerala
THEME_preprocess_paragraph(&$variables) {
$media_id = $variables["paragraph"]->field_content_image->target_id;
$media_entity = Media::load($media_id);
$file_id = $media_entity->getSource()->getSourceFieldValue($media_entity);
$bg_file = File::load($file_id);
$path = $bg_file->createFileUrl();
}
This worked for me.
The $path variable has the folder path for the file. This logic can used in preprocess_page hook also by replacing the $variables["paragraph"]
with appropriate paragraph object.