Choosing Preview and then Post on the last chapter of a multi-chapter draft does not post all chapters, making the work inaccessible to everyone but the creator

Description

Steps to reproduce:

  1. Log in

  2. Post > New Work

  3. Fill in required information

  4. Press Preview

  5. Press Save Without Posting

  6. Follow Add Chapter

  7. Fill in required information

  8. Press Preview

  9. Press Post

What should happen:
Both chapters should be posted. The work should show Chapters: 2/2. You should be able to access it.

What happens instead:
Only the second chapter is posted. The work shows Chapters: 1/?. If you are logged in as anyone other than the work creator, you can't access the work – you get redirected to your user page with the message, "Sorry, you don't have permission to access the page you were trying to reach." If you're logged out, you get redirected to the log in page with the same error message.

Notes:
If you do Post Without Preview on the second chapter, everything works fine: both chapters are posted, the work is accessible by everyone, and it shows Chapters: 2/2.

When is merged, there will be a pending spec for this in spec/controllers/chapters_controller_spec.rb.

"Chapter by Chapter mode gives 500 error when a work's chapters are reordered to make a draft chapter the first chapter" might also be of interest – this is a way to make the first chapter a draft without reordering.

Activity

Show:
Sarken
March 15, 2021, 3:10 AM

I tested this today and have a quick note! When the issue says only chapter 2 is posted, it really does mean that only chapter 2 is posted. The work itself remains a draft and does not appear in any listings.

Sarken
July 10, 2018, 2:26 AM

Hi, cresenne!

Since you've retired as a volunteer, I'm removing you as the assignee from this and AO3-5068. However, if you still want to contribute and would like your Jira privileges restored so you can claim issues again, please shoot an email to either the chair address or the mailing list.

Thanks!

Sarken
September 22, 2017, 8:27 PM

Properly reverted to old behavior!

Sarken
September 22, 2017, 6:47 AM

Additional testing reveals that if you have, for example, a draft with three draft chapters, and you use either the Post or Post Chapter button on the third draft chapter, that posts chapters one and three, but leaves chapter two as a draft. No one involved in testing (Sarken, Lady Oscar, Sammie) believed this was desirable behavior. We couldn't quite agree on what the desired behavior is, except of course that the work should not be inaccessible.

We know works being inaccessible due to chapter one being a draft is a problem, but it appears to be a problem that can be caused in multiple ways (e.g. deleting all but a draft chapter will also make a work inaccessible to everyone except the creator). So we're going to revert this until we have a better idea of how to handle this problem.

Thank you for taking a shot at it!

Sarken
September 20, 2017, 7:33 AM
Edited

I followed the steps above and https://test.archiveofourown.org/works/1066533 posted both chapters correctly, with the work showing as Chapters: 2/2.

Looks good!

ETA: I deleted the work like a dipshit.

Assignee

Unassigned

Reporter

Sarken

Roadmap

Works

Priority

Medium

Affects versions

Fix versions

None

Components

BackEnd

Difficulty

Medium

Milestone

Internal 0.9