Making WordPress.org

Opened 7 years ago

Closed 7 years ago

#2851 closed defect (bug) (fixed)

Turn off Auto-Save for Un-named Vendor Payments and Reimbursement Drafts

Reported by: andreamiddleton's profile andreamiddleton Owned by: coreymckrill's profile coreymckrill
Milestone: Priority: high
Component: WordCamp Site & Plugins Keywords: good-first-bug has-patch needs-testing
Cc:

Description

Organizers are running into trouble when they open a payment request, upload the media files of receipts, and then let the post sit, un-named, until it auto saves. The problem occurs if you forget that you started that draft and closed all your tabs or something: because the draft wasn’t named, it won’t show up on the list of payment or reimbursement drafts. BUT, when the organizer comes back to make a new draft and tries to attach the already-uploaded files to the payment request from the media library, the attachments fail because we don't allow media files to be attached to multiple payments or reimbursement posts.

The work-around is to go to the media library and “detach” the files from the auto draft post that they can’t see anywhere, but that's a pretty bad user experience.

We can't just allow people to attach media files of receipts to multiple payment/reimbursement posts, because we don't want to pay or reimburse on the same invoice or receipt twice. I think if we turn off auto-save for un-named payment and reimbursement drafts, it will solve this particular problem.

Attachments (3)

2851.diff (2.1 KB) - added by hlashbrooke 7 years ago.
Sets a default post title for reimbursments, vendor payment and sponsor invoices
2851.1.diff (2.3 KB) - added by hlashbrooke 7 years ago.
Prepending unique post ID to default title
2851.2.diff (2.3 KB) - added by hlashbrooke 7 years ago.
Adding 'Untitled' to default post titles

Download all attachments as: .zip

Change History (16)

#1 @coreymckrill
7 years ago

  • Keywords needs-patch added
  • Owner set to coreymckrill
  • Status changed from new to accepted

#2 @coreymckrill
7 years ago

  • Keywords good-first-bug added

This ticket was mentioned in Slack in #meta-wordcamp by coreymckrill. View the logs.


7 years ago

#4 @coreymckrill
7 years ago

  • Owner changed from coreymckrill to miss_jwo
  • Status changed from accepted to assigned

#5 follow-up: @grapplerulrich
7 years ago

After playing around with this for some time. The problem is that WordPress saves the post as auto-draft if it does not have a title. If the post has a title it saves it to draft status.

The solutions that I see are adding a default title so that there is always a title or blocking the attaching of files till there is a title.

#6 in reply to: ↑ 5 ; follow-up: @miss_jwo
7 years ago

Replying to grapplerulrich:

The solutions that I see are adding a default title so that there is always a title or blocking the attaching of files till there is a title.

I really like that as a solution. I had thought of other solutions and tehre were teh soluctiosn that we discussed on Slack as a team but just adding a default title would fix the issue and be simple enough to fix.

@andreamiddleton would you be happy with a solution where we just add in a default title per new autosave if any field as been filled in?

#7 in reply to: ↑ 6 @andreamiddleton
7 years ago

@andreamiddleton would you be happy with a solution where we just add in a default title per new autosave if any field as been filled in?

Yes, I'd prefer the default title solution. Blocking the attachment of files sounds like it'll be frustrating for users. :)

@hlashbrooke
7 years ago

Sets a default post title for reimbursments, vendor payment and sponsor invoices

#8 @hlashbrooke
7 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

The attached patch (2851.diff) sets a default post title for reimbursments, vendor payments and sponsor invoices. It doesn't modify the post that is saved - it simply pre-fills in the title input field with a default value so something will always be there.

@andreamiddleton @miss_jwo @coreymckrill Do you think that meets the requirements here?

@hlashbrooke
7 years ago

Prepending unique post ID to default title

#9 @hlashbrooke
7 years ago

After chatting with @miss_jwo we decided that prepending a unique ID to the default title would be beneficial. This patch will create the default titles like this: [6271] Reimbursement Request where 6271 is the auto-generated incremental post ID.

Users will still be able to edit this title of course - this is purely for the sake of having a default value stored there.

#10 @coreymckrill
7 years ago

  • Owner changed from miss_jwo to coreymckrill
  • Status changed from assigned to reviewing

#11 @coreymckrill
7 years ago

@hlashbrooke patch looks great! Works as advertised. What do you think about adding the word "Untitled" into the defaults, so it's more obvious that the organizer should change it to something useful?

E.g. [6271] Untitled Reimbursement Request

@hlashbrooke
7 years ago

Adding 'Untitled' to default post titles

#12 @hlashbrooke
7 years ago

Good idea @coreymckrill - I have updated patch as you suggested.

#13 @coreymckrill
7 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 6717:

WordCamp Payments: Add default title for all payment posts

Having a default title on the new post screen prevents the post from being
saved as auto-draft, which causes problems if attachments have been added
to the post.

Fixes #2851
Props hlashbrooke, miss_jwo

Note: See TracTickets for help on using tickets.