I guess we want something similar: if a new board is created on a page that used to exist, old topics don't come back.
T90973: T9. When deleting board or topic, contributions should move from Contributions to DeletedContributions & T90969: T4. Deleting board does not delete the topics or make them inaccessible make sure topics in a deleted board show up (or don't) in the correct places.
However, what happens when a new board is later started on that same page?
Currently, that would (likely - haven't tested) result in those topics to start re-appearing, because that page is no longer deleted.
I was wondering about how to handle restores when a new board has already been created.
Current (non-Flow) behavior seems rather wonky (probably because this never or rarely ever happens):
I created a page & deleted it.
- archive has an entry for this page
- page no longer has an entry
Create the page, again.
- archive has entry got deleted version
- page has entry for new version
Then restored the old version that was deleted.
- archive no longer has an entry
- page still has only 1, the new board (not the one we restored)
Result: restore didn't overwrite page & now it's gone.
workflow_page_id is (well, should be, there's a bug) already storing the page id. We can use it to distinguish between different "versions" of the page.
If a new board is created, it'll get a new page table row, with a new page_id.
- Fix the bug where workflow_page_id isn't properly populated
- When a page/board is restored, make sure workflow_page_id is updated to new page_id (via hook?)
- Make Workflow pageId aware (right now, workflows are loaded based on namespace & dbkey)
- Fix these deletion thingies to be pageId aware (2 bits of ->getArticleID() !== 0 in code)