Page MenuHomePhabricator

CommunityRequests data and related pages are not deleted when an entity page is deleted
Closed, ResolvedPublic5 Estimated Story PointsBUG REPORT

Assigned To
Authored By
MusikAnimal
Sep 30 2025, 6:37 PM
Referenced Files
F71610840: 2026-01-26_09-54-55.png
Jan 26 2026, 8:58 PM
F71610838: 2026-01-26_09-54-42.png
Jan 26 2026, 8:58 PM
F71610836: 2026-01-26_09-54-25.png
Jan 26 2026, 8:58 PM
F71610834: 2026-01-26_09-54-13.png
Jan 26 2026, 8:58 PM
F71610821: 2026-01-26_09-48-53.png
Jan 26 2026, 8:58 PM
F71610817: 2026-01-26_09-48-11.png
Jan 26 2026, 8:58 PM
F71610815: 2026-01-26_09-47-48.png
Jan 26 2026, 8:58 PM
F71450535: 2026-01-05_16-02-34.png
Jan 6 2026, 12:19 AM

Description

Steps to replicate the issue (include links if applicable):

  • Create a wish or focus area with a vote-able status
  • Add a vote, verify it is visible
  • Make note of the entity page ID (can be found at i.e. Community Wishlist/W1?action=info)
  • Verify the entity is in the communityrequests_entities table, ala SELECT * FROM communityrequests_entities WHERE cr_page = :pageid
  • Delete the page

What happens?:

  • The row is still in the communityrequests_entities table, and the /Votes subpage still exists.
  • When an entity of focus area type is deleted, wishes in that focus area should nullify cr_focus_area

What should have happened instead?:

The corresponding rows in our tables should be deleted, as should the /Votes page.

Other information (browser name/version, screenshots, etc.):

We are supposedly deleting the data with the PageDeleteComplete hook – the code is there – it just doesn't appear to work. In my testing, the hook handler is not called at all. Regardless, the code does no queue a job to delete the Votes page, as it should.

In case it effects the implementation, note we also need to ensure deletion of data happens when deleting pages via Extension:Translate, which is done via job queue (DeleteTranslatableBundleJob).


Derived Requirement

Ensure that when a CommunityRequests entity page (wish or focus area) is deleted, all related CommunityRequests data is fully and reliably cleaned up. This includes removing corresponding database records, deleting associated /Votes subpages, maintaining referential integrity for related wishes, and ensuring consistent behavior regardless of whether the deletion occurs via standard page deletion or through Extension:Translate job-based deletion.

Test Steps

Test Case 1: Delete Wish Entity Page and Remove All Associated Data

Preconditions

  • A wish entity page exists with a vote-able status.
  • At least one vote has been added and is visible.
  • The wish has an associated /Votes subpage.
  • A corresponding row exists in the communityrequests_entities table for the wish page ID.
  1. Navigate to the existing wish entity page.
  2. Verify that votes are visible on the wish page.
  3. Confirm the wish page ID via the page information view.
  4. Delete the wish entity page using standard page deletion.
  5. Check whether the /Votes subpage still exists.
  6. ✅❓❌⬜ AC1: Confirm that deleting a wish entity page removes its database record and deletes the associated /Votes subpage.

Test Case 2: Delete Focus Area Entity and Nullify Related Wishes

Preconditions

  • A focus area entity page exists with a vote-able status.
  • One or more wishes are associated with this focus area.
  • Votes and a /Votes subpage exist for the focus area.
  1. Navigate to the focus area entity page.
  2. Verify that associated wishes reference the focus area in cr_focus_area.
  3. Delete the focus area entity page.
  4. Check whether the focus area /Votes subpage still exists.
  5. ✅❓❌⬜ AC2: Confirm that deleting a focus area removes its database record and /Votes subpage

QA Results - Meta Beta

ACStatusDetails
1T406059#11555509
1T406059#11555509

Event Timeline

MusikAnimal renamed this task from CommunityRequests data not deleted when an entity page is deleted to CommunityRequests data and related pages are not deleted when an entity page is deleted.Sep 30 2025, 6:40 PM
MusikAnimal updated the task description. (Show Details)
MusikAnimal updated the task description. (Show Details)
MusikAnimal set the point value for this task to 5.
dmaza changed the task status from Open to In Progress.Oct 1 2025, 1:46 PM
dmaza claimed this task.

Change #1194224 had a related patch set uploaded (by Dmaza; author: Dmaza):

[mediawiki/extensions/CommunityRequests@master] [WIP]

https://gerrit.wikimedia.org/r/1194224

Change #1195768 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/CommunityRequests@master] DeleteOrphanedEntityRows: new maintenance script for DB cleanup

https://gerrit.wikimedia.org/r/1195768

Change #1195768 merged by jenkins-bot:

[mediawiki/extensions/CommunityRequests@master] DeleteOrphanedEntityRows: new maintenance script for DB cleanup

https://gerrit.wikimedia.org/r/1195768

Change #1198074 had a related patch set uploaded (by Dmaza; author: Dmaza):

[mediawiki/extensions/CommunityRequests@master] Fix entities not getting deleted on PageDeleteComplete

https://gerrit.wikimedia.org/r/1198074

Change #1194224 abandoned by Dmaza:

[mediawiki/extensions/CommunityRequests@master] Fix entities not getting deleted on PageDeleteComplete

Reason:

In favor of https://gerrit.wikimedia.org/r/c/mediawiki/extensions/CommunityRequests/+/1198074

https://gerrit.wikimedia.org/r/1194224

Change #1198074 merged by jenkins-bot:

[mediawiki/extensions/CommunityRequests@master] Fix entities not getting deleted on PageDeleteComplete

https://gerrit.wikimedia.org/r/1198074

dmaza changed the task status from In Progress to Open.Dec 2 2025, 8:16 PM
dmaza moved this task from Feedback and Review to QA on the Community-Tech (Sea Lion Squad) board.

@dmaza Please review AC1 and AC2, thanks!

Test Result - Meta Beta

Status: ❌ FAIL
Environment: Meta Beta
OS: macOS Tahoe 26.1
Browser: Chrome 143
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Delete Wish Entity Page and Remove All Associated Data

Preconditions

  • A wish entity page exists with a vote-able status.
  • At least one vote has been added and is visible.
  • The wish has an associated /Votes subpage.
  • A corresponding row exists in the communityrequests_entities table for the wish page ID.
  1. Navigate to the existing wish entity page.
  2. Verify that votes are visible on the wish page.
  3. Confirm the wish page ID via the page information view.
  4. Delete the wish entity page using standard page deletion.
  5. Check whether the /Votes subpage still exists.
  6. AC1: Confirm that deleting a wish entity page removes its database record and deletes the associated /Votes subpage.

Wish was deleted and doesn't showing on the Community Wishlist but you can still pull in the vote

Page InfoWish DeleteCommunity Wishlist❌Vote❌Vote ID
2026-01-05_15-56-23.png (1×1 px, 462 KB)
2026-01-05_15-53-58.png (905×992 px, 165 KB)
2026-01-05_15-53-26.png (1×974 px, 158 KB)
2026-01-05_15-54-11.png (749×1 px, 81 KB)
2026-01-05_15-55-59.png (749×1 px, 87 KB)

Test Case 2: Delete Focus Area Entity and Nullify Related Wishes

Preconditions

  • A focus area entity page exists with a vote-able status.
  • One or more wishes are associated with this focus area.
  • Votes and a /Votes subpage exist for the focus area.
  1. Navigate to the focus area entity page.
  2. Verify that associated wishes reference the focus area in cr_focus_area.
  3. Delete the focus area entity page.
  4. Check whether the focus area /Votes subpage still exists.
  5. AC2: Confirm that deleting a focus area removes its database record and /Votes subpage

Voting on a Focus Area is not available. Unless you are saying when a wish has a vote and a Focus Area associated with it, deleting the FA, removes the vote of the wish?

2026-01-05_16-02-34.png (1×963 px, 157 KB)

GMikesell-WMF changed the task status from Open to In Progress.Jan 6 2026, 12:20 AM
GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF moved this task from QA to In Development on the Community-Tech (Sea Lion Squad) board.

I'll take a look at AC1.

AC2: Voting on a Focus Area is not available. Unless you are saying when a wish has a vote and a Focus Area associated with it, deleting the FA, removes the vote of the wish?

Focus Areas can be voted on. The one in the screenshot is under-review and that's why it can't be voted-on until T409613 is deployed. Focus Areas will unlikely ever be in under-review state since they are managed by us. In any case, as of now, if you change the status to "Accepted" you will have the option to vote on it. This means that if FA14 has any votes, FA14/Votes should also be removed when the FA is removed.

As far as the acceptance criteria regarding deleting a FA with associated wishes; Votes on wishes should remain unchanged. What should happen is that the FA field on the wish should change to "unassigned" since the focus area was removed. Does that make sense?

This comment was removed by dmaza.

Change #1224997 had a related patch set uploaded (by Dmaza; author: Dmaza):

[mediawiki/extensions/CommunityRequests@master] Fix: Votes subpage not getting deleted

https://gerrit.wikimedia.org/r/1224997

Change #1224997 merged by jenkins-bot:

[mediawiki/extensions/CommunityRequests@master] Fix: Votes subpage not getting deleted

https://gerrit.wikimedia.org/r/1224997

dmaza changed the task status from In Progress to Open.Jan 26 2026, 5:11 PM
dmaza moved this task from In Development to QA on the Community-Tech (Sea Lion Squad) board.

@dmaza Confirmed that deleting a wish/fa entity page removes its database record and deletes the associated /Votes subpage, as seen in the screenshots. I will now mark this as Resolved. Thanks for all your work!

Test Result - Meta Beta

Status: ✅ PASS
Environment: Meta Beta
OS: macOS Tahoe 26.2
Browser: Chrome 143
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Delete Wish Entity Page and Remove All Associated Data

Preconditions

  • A wish entity page exists with a vote-able status.
  • At least one vote has been added and is visible.
  • The wish has an associated /Votes subpage.
  • A corresponding row exists in the communityrequests_entities table for the wish page ID.
  1. Navigate to the existing wish entity page.
  2. Verify that votes are visible on the wish page.
  3. Confirm the wish page ID via the page information view.
  4. Delete the wish entity page using standard page deletion.
  5. Check whether the /Votes subpage still exists.
  6. AC1: Confirm that deleting a wish entity page removes its database record and deletes the associated /Votes subpage.

Wish was deleted and doesn't showing on the Community Wishlist but you can still pull in the vote

WishWish DeleteWish Vote Page
2026-01-26_09-47-48.png (1×1 px, 183 KB)
2026-01-26_09-48-11.png (901×1 px, 165 KB)
2026-01-26_09-48-53.png (809×1 px, 135 KB)

Test Case 2: Delete Focus Area Entity and Nullify Related Wishes

Preconditions

  • A focus area entity page exists with a vote-able status.
  • One or more wishes are associated with this focus area.
  • Votes and a /Votes subpage exist for the focus area.
  1. Navigate to the focus area entity page.
  2. Verify that associated wishes reference the focus area in cr_focus_area.
  3. Delete the focus area entity page.
  4. Check whether the focus area /Votes subpage still exists.
  5. AC2: Confirm that deleting a focus area removes its database record and /Votes subpage
FAFA Vote PageFA DeleteFA Vote Page Delete
2026-01-26_09-54-13.png (1×1 px, 200 KB)
2026-01-26_09-54-25.png (678×1 px, 78 KB)
2026-01-26_09-54-42.png (685×1 px, 135 KB)
2026-01-26_09-54-55.png (684×1 px, 111 KB)
GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF updated Other Assignee, removed: GMikesell-WMF.