Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Allow book module to handle unpublished content #463

Open
KatieAK-enviro opened this issue Jun 3, 2020 · 6 comments
Open

Allow book module to handle unpublished content #463

KatieAK-enviro opened this issue Jun 3, 2020 · 6 comments

Comments

@KatieAK-enviro
Copy link

Problem

We (Department of Agriculture, Water and the Environment) have sites using the book module to create longform reports, which allows us to take a digital first approach to content that would have traditionally been published as large pdf files.

The book module doesn't currently allow unpublished "books" or "book pages" to be used in the book hierarchy. This makes it impossible to effectively prepare a full report in an unpublished state; which means our content approvers can't see what the finished product will look like before approving content. This is a problem in a Goverment publishing workflow, where embargoed content needs to be prepared ahead of time and only published once approved and generally on a designated launch date.

Solution

Our development partner has investigated and found that this issue has been patched:
https://www.drupal.org/project/drupal/issues/26552

@Belhendo
Copy link

Belhendo commented Jun 9, 2020

Thank you for your suggestion @KatieAK-enviro.

We would look for this in a stable release rather than a patch. As a suggestion, your dev partner could have a conversation with the maintainer on Drupal.org to help expidite this process.

@simesy
Copy link
Contributor

simesy commented Jun 10, 2020

The issue on Drupal.org was created in 2005, the year I started doing Drupal. I agree there would be only one or two sites that need this, so it's not an ideal patch for the distribution, as it's not a simple patch.

For the record, I want to flag that the PaaS scaffold allows patches to be applied on a site-by-site basis and if this strategy ever reached SaaS then there would be a mechanism for the helpdesk solve this problem for just the site in question (not saying it would be ideal, but worth mentioning).

@KatieAK-enviro
Copy link
Author

Thankyou for looking into this. The Department does not currently have the capacity to fund our development partner to work with the maintainer to resolve this issue. I'd be curious to understand how other GovCMS sites that use the book module work around this; as it adds significant complications to our publishing workflow.

@simesy
Copy link
Contributor

simesy commented Jun 30, 2020

It's quite possible that no saas sites are using book module as extensively as you are, govcms team can answer that for sure.

@simesy
Copy link
Contributor

simesy commented Jul 1, 2020

If I needed to solve this on a SaaS site, here is the way I might solve it. I'm putting this here not because it's quick and easy or even wise, but because it would be way less effort than helping a 15 year old issue get merged to Drupal. Technical jargon follows.

  1. Add a new field to the book pages something like field_hide. It will be a check box.
  2. In the preprocess for book pages, check if field_hide is set, and if so return a 404.
  3. From now on publish all pages.

There are a number of side effects of doing this and it should not be done on a whim. There will be a number of places where you need to preprocess to hide content from these pages.

  • It might screw up existing workflow views/operations that are based on unpublished content
  • Your pages will now get indexed in search. If you have a "search_index" view mode that you're using for search, you can preprocess this view mode to output no content so that the "hidden" pages have no content indexed, perhaps a similar treatment on the search results would be fitting.
  • It may still appear in menus. Again preprocess....
  • If you are using any jsonapi or restful services these pages will be accessible
  • It might be difficult for editors to have visibility of what pages are not published, again preprocess or adding field_hidden with views...
  • etc etc.

@Belhendo
Copy link

Hi @KatieAK-enviro

Apologies for the delay in responding, I have just returned from leave.

Thanks @simesy for your contribution in this issue.

Unfortunately, GovCMS doesn't have the resources to progress functionality within modules. I can offer some other options:

  1. Active/Standby could be an option
  2. You could ask your question on Discourse and the govcms community to seek wider input/discussion
  3. You could raise a service desk ticket and our support team can provide you with options for handling embargoed content. A draft function is not recommended for embargoed content.

Hope that's helpful.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants