Geysir would be far more useful in a real world scenario if it worked with draft revisions, preventing the actual deletion of paragraphs and replacing with a removal from the latest revision. It would also need to amend the ajax introduction of content to work with the specific entity revision.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andywhale created an issue. See original summary.

andy_w’s picture

This patch adds the ability for the geysir module to function with revisions, but has the following debatable choices made:
* The use of temporary data on the form state for it to retain the new revision for the purpose of reloading the data by ajax.
* The continued use of the contentEntityDeleteForm as the entity is no longer actually deleted.

andy_w’s picture

Assigned: andy_w » Unassigned
Status: Needs work » Needs review
jover’s picture

Assigned: Unassigned » jover
vollepeer’s picture

Indeed, this is a very important aspect of the full solution. Since Geysir allows authors to manipulate pages in such a quick way, we definitely need a way to "group" these changes and publish them all at once. A few things are needed here:

  • A way to "start" a group of changes. This maps to the concept of revisions in Drupal. We need a way to have a draft version of a page without affecting the published version.
  • A clear indication for authors when they start editing a page whether there is already a draft existing or not
  • A way to compare the new draft version of a page to the published version
  • A trigger to publish the draft

In attachment there is a example screenshot of how part of that interface could look like.

DamienMcKenna’s picture

Category: Feature request » Bug report
Priority: Normal » Major

Given this breaks revision handling, which is one of the key reasons to use Paragraphs over other referenced-entity solutions, this is a major bug, not a feature request.

szato’s picture

The uploaded patch works only with the 8.x-1.0-alpha2 release.
I updated patch to works with the actual 8.x-1.0-dev branch.

jover’s picture

FileSize
21.69 KB

Updated the patch to work with updated 8.x-1.x-dev branch.
Also updated the add routes & modal functions with the parent_entity_revision parameter.

@szato @andywhale Can you test & review this please?

Dan_Rogers’s picture

Patch in #8 gives me an error when applied against latest 1.x-dev:

Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("parent_entity") to generate a URL for route "geysir.modal.add_form". in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 182 of /srv/bindings/e8725ad852ef475fa76b0aeb0e40fb3a/code/core/lib/Drupal/Core/Routing/UrlGenerator.php).

This error is seen in the log when viewing a node that has Paragraphs enabled. Patch was applied to existing install of Geysir module(1.x-dev), if it is helpful.

EDIT: Uninstalling/reinstalling patched module cleared errors, and is now working correctly.

szato’s picture

Status: Needs review » Reviewed & tested by the community

Hi jover,

I tested the #8 patch with core 8.4.4 + paragraphs dev-1.x + workbench_moderation 8.x-1.2. It's working.

vollepeer’s picture

I tested the patch #8 on Drupal 8.4.4 using Geysir 8.x-1.x-dev and the core content_moderation + workflows modules.

When working on draft versions of a page, I experience several situations in which the changed made through Geysir are not reflected in the page when the modal closes. Moreover, I've seen cases in which I edited a paragraph, data from another revision is loaded in the modal.

I have to do further tested to dig out and clarify these issues.

golddragon007’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
21.83 KB
511 bytes

Patch #8 has an issue with workbench_moderation module. If you edit a content which has enabled revision control and you actually edit a Draft unpublished content, added new paragraphs won't appear after ajax response (adding to a published worked). I attach a patch which fix this issue.

vollepeer’s picture

The last patch in #12 works good. The problems mentioned in #11 are now solved.

One side issue to be tackled: once a draft is created for a node, we should prevent further edits on the published revision. If not, conflicts will arise between the latest revision (draft) and the published revision. I would say edits directly on the published revision should remain possible (to correct typos e.g., but once a draft is present, this should be prevented. I created a new issue for this: https://www.drupal.org/project/geysir/issues/2939188

vollepeer’s picture

Status: Needs review » Reviewed & tested by the community
jover’s picture

Status: Reviewed & tested by the community » Fixed

Patch committed.

  • jover committed 3174bdd on 8.x-1.x
    Issue #2895354 by golddragon007, andywhale, szato, jover: Introduction...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.