Placeholder for effort to port Drafty to D8.

Comments

tsvenson’s picture

The ambitions are *high* I see ;)

Like the name and decoupling idea behind Drafty, so look forward to hear more about the 8.x version.

catch’s picture

Before doing this, it'd be good to look at enabling proper support for forward revisions in core. The main thing that's needed is the ability to save a revision without updating the base tables (either entity or field), then 99% of drafty becomes unnecessary.

tsvenson’s picture

What's "forward revisions", sounds almost like a *scheduling* mechanism for working on more than one draft version of the same entity?

catch’s picture

No it just means you save a revision without updating the 'current' revision.

So in Drupal 7 it'd mean being able to save to {node_revision} and {field_revision_field_$field_name} without touching {node} or {field_data_$field_name}.

tsvenson’s picture

Ahh, so basically *something* that helps only *touching*, for example, those fields that only needs to be changed? Those only affected by the 'current' update request...

jhedstrom’s picture

Before doing this, it'd be good to look at enabling proper support for forward revisions in core.

I've looked for core issues regarding this, do you know if there's an existing one? I've found the UI enhancements mega issue #1776796: Provide a better UX for creating, editing & managing draft revisions., but that seems unlikely for 8.0 at this point.

catch’s picture

#218755: Support revisions in different states may actually have added this. I'd forgotten that issue got committed.

tsvenson’s picture

@catch, sorry to ask.

I'm curious, see #2, about what the remaining 1% is?

Thinking that would be helpful for me to know so I better understand your plans with Drafty.

tsvenson’s picture

@jhedstrom, thanks for the tip about the revision #UX issue. Saves me tons of time not finding it ;)

catch’s picture

So yes #218755: Support revisions in different states allows forward revisions to be created, which is the only tricky thing that drafty handles.

Apart from that it's just helpers for forcing all edits to be draft revisions, and a helper to 'publish' a previous draft revision - but that's a few lines of code.

There's a couple of things that should still be shared functionality between workflow modules rather than backed in (if they're not already handled in 8.x)

1. https://www.drupal.org/project/entity_status

2. CPS has some code to force newly created entities to unpublished for the default revision, then the draft is published. This doesn't suit every workflow but like the things drafty does it's tricky to get that right (although may be easier in 8.x with proper forward-revision support). I'd thought about factoring that out to a drafty sub-module for 7.x, but no issue for this yet.

jhedstrom’s picture

It seems highly unlikely that https://www.drupal.org/node/1776796#comment-9654107 will make it into 8.0.0 since it adds a new module, so I'm considering moving the 'moderation' module in that patch into contrib so it's easier to maintain than a patch. Drafty seems like an appropriate place rather than spinning up a new project. Thoughts?

catch’s picture

I'm happy with drafty being the place for 'things that core should be doing but isn't yet' for revisions in 8.x, as long as we have core patches active for minor versions with the functionality (assuming it's possible to do at all, but most revisions things should be).

wim leers’s picture

Per commentary here, it's sounding somewhat like Drafty is obsolete in Drupal 8|9?

catch’s picture

Status: Active » Closed (outdated)

Definitely.