diff --git a/includes/EchoHooks.php b/includes/EchoHooks.php index 67cfa5f00..a0b2e0c83 100644 --- a/includes/EchoHooks.php +++ b/includes/EchoHooks.php @@ -1405,7 +1405,7 @@ class EchoHooks { $thankYouIds = []; $thankYouRows = $dbw->select( [ 'echo_notification', 'echo_event' ], - 'echo_event.*', + EchoEvent::selectFields(), [ 'notification_user' => $newUser->getId(), 'notification_event = event_id', diff --git a/includes/model/Event.php b/includes/model/Event.php index 9049cb4a2..bec10f91f 100644 --- a/includes/model/Event.php +++ b/includes/model/Event.php @@ -723,4 +723,25 @@ class EchoEvent extends EchoAbstractEntity implements Bundleable { public function getSortingKey() { return $this->getTimestamp(); } + + /** + * Return the list of fields that should be selected to create + * a new event with EchoEvent::newFromRow + * @return string[] + */ + public static function selectFields() { + return [ + 'event_id', + 'event_type', + 'event_variant', + 'event_agent_id', + 'event_agent_ip', + 'event_page_namespace', + 'event_page_title', + 'event_extra', + 'event_page_id', + 'event_deleted', + ]; + } + }