Skip to content

Forums V2 with retired user results in a display error when viewing posts #817

@blarghmatey

Description

@blarghmatey

After migrating courses to the Forums V2 backend, both when using the MongoDB and MySQL backends, if the course has a learner account that has been retired then the discussion MFE is unable to render posts. When clicking on any post in the course it yields a console error of:

Error: Missing ":learnerUsername" param
    s history.ts:494
    E utils.ts:829
    E utils.ts:815
    v AuthorLabel.jsx:108
    React 7
        pi
        wc
        gu
        hu
        pu
        nu
        tu
    O scheduler.production.min.js:13
    T scheduler.production.min.js:14
    <anonymous> task.js:61
    P task.js:35
    j task.js:46
react-dom.production.min.js:188:120

The relevant block appears to be in AuthorLabel.jsx with the code block:

  const learnerPostsLink = (
    <Link
      data-testid="learner-posts-link"
      id="learner-posts-link"
      to={generatePath(Routes.LEARNERS.POSTS, { learnerUsername: author, courseId })}
      className="text-decoration-none text-reset"
      style={{ width: 'fit-content' }}
    >
      {!alert && authorName}
    </Link>
  );

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions