Support exporting entity reference revisions

Created on 23 August 2021, over 3 years ago
Updated 21 March 2024, 9 months ago

Export rendered entity formatter can and should support entity_reference_revisions fields.

πŸ’¬ Support request
Status

Closed: cannot reproduce

Version

2.0

Component

Code

Created by

πŸ‡¬πŸ‡·Greece s.messaris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡·Greece s.messaris

    After using this for a good while without problems, I run into a problem with revisions. I am adding an updated patch with some code from \Drupal\entity_reference_revisions\Plugin\Field\FieldFormatter\EntityReferenceRevisionsFormatterBase::prepareView()

  • Status changed to Postponed: needs info almost 2 years ago
  • πŸ‡¨πŸ‡­Switzerland cburschka

    I haven't touched this module in a while, and am currently trying to relearn the structure.

    I see there is already rest_views_revisions submodule with an entity_reference_revisions_export field formatter that its PHPdoc comment claims "exports the rendered entity" of an entity_reference_revisions field.

    Does that one not fulfil the functionality needed here? As far as I can tell, the inheritance chain here is:

    - core EntityReferenceFormatterBase (ERFB) is the base class for entity reference formatters.
    - core EntityReferenceEntityFormatter (EREF) extends ERFB and is the base class for displaying entity reference as rendered entity.
    - rest_views EntityReferenceExportFormatter (ERXF) extends EREF.
    - entity_reference_revisions EntityReferenceRevisionsEntityFormatter (ERREF) extends EREF.
    - rest_views_revisions EntityReferenceRevisionsExportFormatter (ERRXF) extends ERXF, *and* simultaneously wraps an instance of ERREF, as an adapter. It does this to delegate the ::prepareView() call to entity_reference_revisions' ERREF (similar to what this patch copy-pastes into the main ERXF), while allowing its actual parent ERXF to handle the ::view() call.

  • πŸ‡¬πŸ‡§United Kingdom joekers UK

    @cburschka I think what you're saying is right - the sub-module should cover entity reference revisions, however in my case, on the export nothing is printing for this type of entity. I'm not sure if it's best to create a new issue for it?

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    I am moving support to version 3, can you please confirm if this issue still exists in version 3.
    If it does still exist please change the version dropdown to 3.0.x and set the status to Needs Work.

    There is a submodule in version 3 for this that should cover your use case.

    Thank you!

  • Status changed to Closed: cannot reproduce 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    I've confirmed that paragraphs work in version 3. Please reopen this if you experience this on the latest version.

Production build 0.71.5 2024