BUG: Re-Cross-Listing sections to original course causes UI/API problems

lsloan
Community Participant

Hi, all.

My colleagues and I noticed a strange behavior in Canvas recently.  If a section from one course (say, ID=1) gets cross-listed to another course (ID=2) and subsequently gets re-cross-listed back to the original course (again, ID=1), the Canvas UI and API get into an unusual state.

That is, the UI still shows the "De-Cross-List" button for the section. Clicking it and approving the action appears to be successful, showing the message "Section successfully de-cross-listed!".  However, the "De-Cross-List" button remains.  No matter how many times that button is used, it never goes away.

In the API, the data for the re-cross-listed section refers to itself…

  {
    "id": 550100,
    "name": "re-cross-list me to my original course!",
    "course_id": 1,
    "nonxlist_course_id": 1
  }

(That is only an excerpt of the full data returned for section.)

If we call API functions to de-cross-list the section, they always succeed, but requesting the data about the section never changes.  Likewise, the UI for the section appears as described above.

Granted, this seems to be a rare case.  As far as we can tell, sections may get re-cross-listed back to their original course because of one of the following scenarios…

  • Someone wanted to de-cross-list the section, but they accidentally clicked the "re-cross-list" button instead and followed the prompts.
  • Someone cross-listed and re-cross-listed the section to one after another multiple courses.  At some point in the process, they forgot which course the section was cross-listed to originally, so they happened to re-cross-list it to that course.

I think the Canvas UI/API logic should be changed to automatically de-cross-list sections when appropriate.  That is, if a section is being re-cross-listed to its original course, then that operation should be treated as de-cross-listing instead.  That would leave the section UI in a good state, without the "de-cross-list" button and the API would no longer show that the section is cross-listed because the `nonxlist_course_id` value would be `null`.

Labels (1)
0 Likes