Page MenuHomePhabricator

PagedMovedEvent should carry reason data
Closed, ResolvedPublic

Description

In order for PagedMovedEvent to replace PageMoveCompleteHook implementations, it should carry reason data, and provide getters to expose it.

References

Details

Event Timeline

@gmodena I assumed this should be addressed for Q4, so move it.

This can follow the example of PageDeletedEvent.

@daniel

Here I'm thinking of adding

getReason(): string|null

Does the naming track with you? IIRC we discussed about overlap between reasons and comments, but I don't remember which one is the idiomatic/modern terminology for this case.

@gmodena I assumed this should be addressed for Q4, so move it.

Thanks.
This is a requirement for T393890: EventBus: replace PageMoveCompleteHook with PageMovedEvent

@daniel

Here I'm thinking of adding

getReason(): string|null

Does the naming track with you?

Yes, except that it should not be nullable. The reason can be empty, but not null. Just do it the same way as it's done on PageDeletedEvent.

IIRC we discussed about overlap between reasons and comments, but I don't remember which one is the idiomatic/modern terminology for this case.

It's worse... "edit summaries" and "edit comments" are the same. User actions (delete, undelete, move, etc) often have a "reason", which is called a "comment" in the log entry. And then events can also have a "cause", which is not controlled by the user, just constants used in the code.

Anyway. It's called a "reason" on MovePage and on PageDeletedEvent, so I think we should be consistent with that.

Change #1146059 had a related patch set uploaded (by Gmodena; author: Gmodena):

[mediawiki/core@master] PageMovedEvent: add move reason information.

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

Change #1146059 merged by jenkins-bot:

[mediawiki/core@master] PageMovedEvent: add move reason information.

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