Page MenuHomePhabricator

Create PageUndeleteComplete hook, analogous to PageDeleteComplete
Closed, ResolvedPublic


PageDeleteComplete hook gives us comprehensive info about the page delete, after it happens.

The older ArticleUndelete hook does not! We do not get timestamp of Undelete, nor do we get the performer. Instead, we have to guess that the current timestamp is close enough to the time of the undelete, and we have to guess that the current RequestContext::getMain()->getUser() is the performer, relying on some global state.

Can we make a PageUndeleteComplete hook?

Event Timeline

Change 876374 had a related patch set uploaded (by OwenR; author: OwenR):

[mediawiki/core@master] Add PageUndeleteCompleteHook

OwenRB triaged this task as Low priority.
OwenRB subscribed.

I took a little go at this - any feedback is appreciated.

Thanks. FYI, there are some ideas and preferences to refactor these core hooks to be single-parameter 'event' hooks - T212482: RFC: Evolve hook system to support "filters" and "actions" only

However, I think we should proceed with your patch as is as it will be useful now, and we already have a PageDeleteComplete hook; having its Undelete counterpart makes sense (even if it is one more hook to migrate away from later).

Change 876374 merged by jenkins-bot:

[mediawiki/core@master] Add PageUndeleteCompleteHook