I am using paragraph module and using that creating paragraph as well as nested paragraph.
So for fetching nested paragraph field data from $paragraph object in Hook_preprocess_paragraph() function I have used referencedEntities().
Below are the code written for paragraph preprocess hook.
$paragraph = $variables['elements']['#paragraph'];
$variables['download_file_list'] = $paragraph->get('field_files')->referencedEntities();
If I access page using node/ [nid] this code is return reference entity values, but if I edit same page and click "Preview" button to preview node referencedEntities() return blank.
So please let me know how we get reference entities in node preview page.
Comments
Comment #2
nitinsp commentedComment #3
miro_dietikerThat looks more like a custom support request than a Paragraphs/ERR bug?
Comment #4
dieterholvoet commentedThis issue is fixed by the patch in #3098924: referencedEntities() causes data loss.