Repository navigation
Scope tag-based collection attribution to the collection owner - #5
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Tag-based persona/collection attribution now applies only to entries authored by the collection owner (the admin account). Entries from other registered accounts keep their poster attribution, even when they carry a persona tag.
Entry::COLLECTION_CLAIM_JOIN_SQLadds the ownership check to the collection join, so non-owner entries resolve to no collection.searchAll()uses an inner join on the collection, so persona pages exclude non-owner entries too.Collection::COLLECTION_SELECTcounts only owner-authored entries, keeping sidebar/collectionentry_countconsistent with what is shown.testNonOwnerEntriesAreNotClaimed(requiresTRAIL_ADMIN_API_TOKENandTRAIL_USER_API_TOKEN).Review focus
The ownership predicate lives in
LEFT JOIN trail_collections ... AND col.owner_user_id = e.user_id. A non-owner entry yieldscol = NULLand thereforecollection => null, without touching the tag join or any entry filtering.Verification
php -lclean on all three files. Integration test suite not executed locally (novendor/); the new test self-skips without both tokens.