As a split-off from #2756417: Integration with the Paragraphs module, add support for Multiversion to Paragraphs, ultimately so that paragraph entities can be used with the Deploy module suite.

Comments

DamienMcKenna created an issue. See original summary.

DamienMcKenna’s picture

This is jeqq's patch from comment 24 in #2756417 separated out.

DamienMcKenna’s picture

Title: Add Multiversion support » Add Multiversion support to Paragraphs
DamienMcKenna’s picture

miro_dietiker’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

I didn't check multiversion in detail, but agree that we should greatly integrate with nice staging workflows.

To unblock this issue, please help work on test coverage.
It also helps me to review the situation as i can see the exact process we try to cover.

Grimreaper’s picture

Hello,

I have tested the patch with the entity reference revisions patch from #2674882-12: Add Multiversion compatibility to Entity Reference Revisions (for Paragraphs, etc) and it does not work.

I have a few questions on the patch:

  1. +++ b/paragraphs.module
    @@ -210,3 +210,43 @@ function template_preprocess_paragraph(&$variables) {
    +        // Make all content entity types revisionable.
    

    I don't understand why the patch needs to affect all content entity types.

  2. +++ b/paragraphs.module
    @@ -210,3 +210,43 @@ function template_preprocess_paragraph(&$variables) {
    +        switch ($entity_type->id()) {
    +          case 'paragraph':
    

    Should this check on paragraph entity type must be done before?

vflirt’s picture

I have made a minor change in the patch as it seems to be just copied over from the linked issue. The paragraph supports revision so the lines for the checks are removed.
Also the patched introduced a hidden dependency on entity_storage_migrate so I wrapped the storage_schema in a module exists check.
I have not touched any of the other code. I have tested and this seems to work, I got my node with the paragraphs transferred with deploy.
There is one other thing that needs work on: once the paragraphs got transferred then the workspace started showing conflict and when I try to view the conflict I got :
Error: Call to undefined method Drupal\paragraphs\Entity\Paragraph::getChangedTime() in Drupal\workspace\Controller\Component\ConflictListBuilder->buildRow() (line 158 of modules/contrib/workspace/src/Controller/Component/ConflictListBuilder.php).
Not sure if a 'changed' field should be added to paragraphs content type.

In order to make the deploy worked I had to update the "multiversion.setting" enabled_entity_types and add paragraph, then had to clear cache so multiversion could add the database fields and all to work out. I tried to use the multiversion drush command to enable paragraph but it failed with sql error that the needed database columns did not exist.