The user activity page was corrupted after importing the GitLab export project

Summary

After importing a Gitlab export project, there is an error in the user activity page.

Steps to reproduce

  1. Create a project A
  2. Create an issue I for A
  3. Create a comment for I
  4. Settings -> General -> Advanced -> Export project, export the project
  5. Create a Project B by importing the Gitlab export file
  6. An error occurs when accessing the User Activity page

Example Project

What is the current bug behavior?

An error occurs when accessing the user activity page.

What is the expected correct behavior?

There is no error when accessing the user activity page.

Relevant logs and/or screenshots

image image image image

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes