Support revisions and content moderation with the Layout Paragraphs Builder Field Formatter

Created on 11 March 2022, almost 3 years ago
Updated 25 August 2023, over 1 year ago

Currently, using the frontend builder simply edits the current revision and does not provide any options for creating a new revision. Ideally, the builder would provide an interface for choosing "Create a new revision".

✨ Feature request
Status

Needs work

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States justin2pin

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

Merge Requests

Comments & Activities

Not all content is available!

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

  • πŸ‡ΊπŸ‡ΈUnited States josh.stewart Lexington, KY

    I'd be interested in knowing if this is on the horizon at all. I don't know if I can help at all but I will try. Love this admin building experience from this module but have a client that needs moderation and/or revisions to work.

  • πŸ‡³πŸ‡±Netherlands dennis_meuwissen

    We are also running into this problem where we love how editors can build pages with this, but revisions are also a requirement. Here is our current still incomplete patch based on the work from the fork. We are using it exclusively to build the paragraph layouts in a frontend theme so this is untested with editing them inside the backend theme. Content moderation was also not a concern for us, so while the form elements for it are present they have not been tested.

    Some observations:

    • When editing a revision's layout paragraphs, the current revision will be loaded even though you would expect to edit that same revision. A separate route for editing revisions might make sense here to mirror how this works for editing node revisions.
    • The fork code stores the layout paragraphs data in the form state, but it is unclear why. Other parts of layout paragraphs code such as the LayoutParagraphsBuilder element expect it to be available in the tempstore.
    • Clearing the revision log message from user input does not work, even when rebuilding the revision form state. We had problems where the previous revision kept being reloaded after saving for reasons still unknown.
  • First commit to issue fork.
  • πŸ‡§πŸ‡ͺBelgium kristiaanvandeneynde Antwerp, Belgium

    Going to see if I can get the best of both the patch and MR into a new MR.

  • Pipeline finished with Failed
    14 days ago
    Total: 1049s
    #390875
  • Pipeline finished with Failed
    8 days ago
    Total: 930s
    #396766
  • πŸ‡§πŸ‡ͺBelgium kristiaanvandeneynde Antwerp, Belgium

    Okay so the old MR was actually better in a sense that it emptied out the form and relied solely on the things coming from the form display. Will restore that behavior. I got it to work locally already, just need to work on the validation and submission handling.

  • Pipeline finished with Failed
    7 days ago
    Total: 1036s
    #397827
  • πŸ‡§πŸ‡ͺBelgium kristiaanvandeneynde Antwerp, Belgium

    Okay, locally it works for me now.

    I'm not sure why we need the following, but it was in the very first inception of this class:

        $entity->$field_name = $this->layoutParagraphsLayout->getParagraphsReferenceField();
    

    Also added a form state rebuild at the end of submit just to be safe.

  • Pipeline finished with Failed
    6 days ago
    Total: 998s
    #398665
Production build 0.71.5 2024