Require users to opt in to having their works invited to collections
Description
Activity

lydia-theda March 24, 2023 at 6:15 AM
Disabled JavaScript as account A. Enabled preference as account B. As A, was able to successfully invite B’s work to A’s collection. As B, disabled the preference without accepting or rejecting the invitation. As A, went back a page and attempted to resend the invitation (to the same collection), got a “This item could not be invited.” message. The “Invite to Collections” button was now gone from the page. Repeated the experiment with a different collection, got the same result.
(Noting here that the button text is “Invite to Collections” (invite, plural), since the issue description has add-plural and in my previous comment I think I called it invite-singular? This is just for posterity, I think the current button text is fine!)
Sarken March 24, 2023 at 5:31 AM(edited)
On users' Preferences pages:
new preference there, off by default
old preference removed
help text updated
When "Allow others to invite my works to collections." is unchecked:
as collector, did not see a button to invite the work with or without JavaScript enabled; the form was also absent with JavaScript disabled
as the user with the preference disabled, I could still edit my work to add it to a collection (and then remove it as well)
When "Allow others to invite my works to collections." is checked:
as collector, successfully invited single-creator work to collection, both with and without JavaScript enabled
said creator got an emailed invitation
as collector, successfully invited work where one creator had the preference enabled and one had it disabled, both with and without JavaScript
both creators got an emailed invitation, which did not mention anything about automatic approval in the text or HTML version
successfully approved both invitations (as creator with preference enabled, and them removed and re-invited the work so I could also test approving as the creator with preference disabled)
I could also bookmark a work and add it to a collection, same as always, regardless of the creator’s preference.
Looks good!
Sarken March 20, 2023 at 3:32 AM(edited)
Did you also add a migration for dropping the column for "Automatically agree to your work being collected by others in the Archive”? I don't see one…
ETA: Never mind! I see it wasn’t supposed to.

Runt March 7, 2023 at 11:48 AM
my user has the new preference unchecked, I do not know what the old preference was set to
log in as testy - “Invite to Collection” button not present on my works
“?” on Collections section of user preferences shows the following text (no paragraph spacing):
Allow others to invite my works to collections
Enabling this option will allow other AO3 users to invite your work into their collection. Your work won't be added to the collection until you have accepted the request. For more information on accepting collection invitations, refer to How do I approve or reject an invitation to include my work in a collection?
Leaving this option disabled will prevent other users from inviting your works into their collections at all, and you won't receive any notifications.
Changing this setting won't affect any existing works in collections.
Updated user preference setting to allow inviting to collections
checked work logged in as testy - Invite to Collections button is showing
I did not receive an email (assuming it is delayed)
Checking my users collected works I can see the pending invite
Unselected the “allow others to invite my works to collections box on my user, Invite button is no longer appearing on my works.
Pending collections invite is still pending

lydia-theda February 26, 2023 at 3:13 AM
I don’t remember whether my account had the old preference checked originally or not. The new preference is unchecked.
Clicking the help ? gets me the following text:
Enabling this option will allow other AO3 users to invite your work into their collection. Your work won't be added to the collection until you have accepted the request. For more information on accepting collection invitations, refer to How do I approve or reject an invitation to include my work in a collection?
Leaving this option disabled will prevent other users from inviting your works into their collections at all, and you won't receive any notifications.
Changing this setting won't affect any existing works in collections.
(I note that there is no paragraph spacing on AO3 itself, though)
I don’t see any “Add to collection” button on my works, regardless of who i’m viewing the work as.
Checked the preference and saved.
As myself, there is now an “Invite to collection” button to the left of the bookmark button. As a different user, it took a few minutes for the same button to appear. (As a guest or admin, there is no button)
Submitted a collection invite, as the other-account, to a collection owned by that account. Blue flash message “This work has been invited to your collection (collectionname).” Got an email, the text for both HTML and plaintext looks correct (no paragraph about auto-invites).
On a co-created work where the other co-creator does not have the preference checked, as either creator, I could add the work to any open collection owned by either of us as well as a random open unmoderated collection owned by someone else. (Open moderated collection got told I submitted it for moderation; closed collection got told it wasn’t accepting submissions)
Unchecked the preference and saved.
The collection-invite button was removed from the work regardless of who i’m viewing the work as.
Back-paged so I could still see the invite button. Submitted the collection invite from that tab: red flash message “This item could not be invited.” This occurred even when I was doing it as myself, using a collection that I own.
I’m not sure I tested everything that could be tested here, sorry if not.
Details
Details
Assignee

On users' Preferences pages:
remove "Automatically agree to your work being collected by others in the Archive."
add "Allow others to invite my works to collections." This should be unchecked by default.
This will require a migration, which should use pt-online-schema-change.
The migration should only add the new column. We'll remove the old one in a follow-up deploy.
The description of the old preference should be removed from the help pop-up (
help/collection-preferences.html
).Docs may provide a description for the new preference.
When "Allow others to invite my works to collections." is unchecked:
When none of the creators of a work has checked "Allow others to invite my works to collections.", the "Add To Collections" button should be removed from the work. (Creators can always edit the work itself to add it to a collection.)
Removing the button itself is not sufficient, however; there should also be a back end check to prevent inviting works whose creators do not allow invitations from collections.
When "Allow others to invite my works to collections." is checked:
The behavior when "Allow others to invite my works to collections." is checked should be the same as the existing behavior when "Automatically agree to your work being collected by others in the Archive." is unchecked.
That is, if one of a work's creators has enabled the preference, the "Add To Collections" option should be available on the work.
When a collection moderator fills in the name of their collection, each creator of the work should receive a copy of the
invited_to_collection_notification
email. The work should not be added to the collection until one of its creators has approved its inclusion.The text and HTML versions of the
invited_to_collection_notification
email should be updated to remove the paragraph mentioning how to enable automatic approval.Deploy Notes
This will have a migration:
bundle exec rake db:migrate:up VERSION=20220918015954