Hi,
Is there plans to introduce D8 version of this module?
We (@InternetDevels team) would like to help you with development of this version.
Thanks, grask0.

Comments

rooby’s picture

Yes, patches are welcome.

No work has been done on this yet.

If you submit a patch for the drupal 7 version to this issue that would be the best way forward.

Then once it has had some review and is in a decent state an 8.x branch can be created in the repository.

anavarre’s picture

StatusFileSize
new15.5 KB

Drupal 8 introduces the concept of Save as unpublished for a piece of content. I *think* this might remove the need for Save Draft completely.

Save as unpublished

kingfisher64’s picture

Sounds like this will be unnecessary in 8 then.

Thanks Drupal another UI improvement. :)

pravin ajaaz’s picture

Status: Active » Closed (won't fix)

As this is in drupal 8 core UI, Closing the issue.

unsettlingtrend’s picture

How is this any different than what you could do in Drupal 7 core without this module? You could always save as unpublished.

In particular, I'm looking for the D7 version of this to allow the draft's to be saved without required fields being filled in/before being published.

It feels like this is less "in D8 core" and more "no D8 version planned."

rooby’s picture

Category: Support request » Task
Status: Closed (won't fix) » Active

It might be worth having more discussion then.

The saving incomplete required fields is one of the main use cases of this module.

Since Drupal core already has the draft button though, I wonder if this should happen here or in another module with a name along the lines of "Save incomplete" or something.

On the other hand, if the functionality and code is going to be similar it might be best to just keep it in this module.

Or maybe it should be as a patch for D8 core.

A very brief search hasn't shown anything out there currently so I might look at how easily this will port over to D8 in the next few days.

Maybe the best course of action would be a D8 version of this module, then a patch for D8. Then we can just mark this one as deprecated if the patch ever gets into core.

rooby’s picture

Another very quick glance at the D8 code shows that we should have the relevant pieces to use a similar solution that the D7 version of this module uses.

unsettlingtrend’s picture

I apologize if I'm missing something (but I also like to think/hope/use as a scapegoat anyone else in my position that reaches the thread later), but where is this "draft" button you mention? Do you just mean the "save as unpublished"? Or is it something/a module that's enabled?

I agree with everything else you say though. I feel that it might not be so easy/clearcut to agree on the behavior though, and how it should fit with the content moderation and workflows modules though.

rooby’s picture

Yeah, I was referring to the save as unpublished feature, which is essentially a draft by a different name.

For a D8 version of this module I would expect it work similarly to the D7 version. - Rename buttons and add required validation skipping.
How it fits in with moderation modules would need further consideration.

attheshow’s picture

StatusFileSize
new28.3 KB
new6.19 KB

Here's a first pass at a D8 version/port. I'm attaching both a patch against the 7.x-1.x branch and a zip file version.

rooby’s picture

That's great, thanks.

I'll review it ASAP. I definitely won't get to it today but I should be able to look at it in the next couple of days.

asherry’s picture

Status: Active » Needs review
StatusFileSize
new31.67 KB

Just re-rolling Mark's patch, I think he didn't include some new files that he wrote plus I'm adding one modification that the new submit handler for the 'draft' button will inherit the submit handlers for the existing submit button.

Otherwise it doesn't save the values in the form.

asherry’s picture

I created a sandbox with our work for easy reference
https://cgit.drupalcode.org/sandbox-asherry-2992675

asherry’s picture

StatusFileSize
new31.62 KB

added a fix for the submit handlers that was accidentally unpublishing and publishing nodes

asherry’s picture

StatusFileSize
new31.36 KB
new31.36 KB

Sorry one more fix for the labels being mixed up

asherry’s picture

bgreco’s picture

As of Drupal 8.4, the "Save as unpublished" button is no longer part of core. I applied patch #15 and it works great. Any chance of it being turned into an 8.x release?

pieterjandp’s picture

Patch #15 works, but it seems like #1786442: Allow saving drafts with missing required fields is not included in this patch.

Allowing saving drafts with missing required fields has become more difficult in Drupal 8, because of the added Entity Validation. Any thoughts on how to tackle this problem in a nice way?

I posted an ugly ad hoc solution here. disable_html5_validation is used to disable client side validation, the form is altered with #after_build to prevent the form validation of required fields and #validate is used to remove any NotNull errors related to required fields and to set the entity as validated if no errors remain.

james.williams’s picture

Status: Needs review » Needs work

For anyone running into this - https://www.drupal.org/project/require_on_publish appears to be the answer for how to allow saving drafts without values in required fields in Drupal 8/9.

If this module were to at least restore a button, I think the current patch at least needs updating to work with Drupal 9.

attheshow’s picture

Title: Drupal 8 version » Drupal 8 version, Drupal 9 version
Status: Needs work » Needs review
StatusFileSize
new9.37 KB

Here's a zip of our D9 version (basically just updates the .info.yml file for D9).