djplaner / canvas-collections

Transform Canvas LMS modules by adding structure, visuals, and context
https://djplaner.github.io/canvas-collections/
GNU General Public License v3.0
1 stars 0 forks source link

Unable to activate Canvas Collections v. 1.25 #297

Open omachado-id opened 6 months ago

omachado-id commented 6 months ago

Hello, I've just noticed this within the last couple of days, but I'm no longer able to activate Canvas Collections editing mode. I've tried to do so in several sandbox course shells without success. When toggling Canvas Collections on, I receive the usual dialog:

"Canvas Collections is now on. A new Canvas Collections Configuration page created. It will be used to store Collections data. The page needs to be published before students can see Collections. Removing this page will turn collections off." (I've changed the link above to remove my institution from the link path)

The Collections toggle area then displays an orange "Unpublished" button. When clicking it, I receive a message saying the page doesn't exist, but I can create it now, with a new version of the configuration page, which is blank (no configuration HTML code), being created, so publishing that one doesn't accomplish anything. Meanwhile, an actual configuration page, with the correct config HTML, gets created from the initial toggle on action. Yet, when that one is published, and I click "Edit On, "it isn't recognized by Canvas Collections. I just receive this warning:

Failed to update Collections configuration Reason: Collections configuration page not found.

Which isn't true, since the configuration page already exists and is published. Repeating any of the above just creates a cycle of new configuration page creations. The net result is a series of configuration pages being created. Deleting all to just one published config page does not resolve this cycle. It's my understanding that once the config page is created and published, Canvas Collections recognize it and allow editing to be turned on.

I'm using the latest version of FireFox (64 bit), v. 125.0.1. For institutional reasons, I don't run Canvas Collections in Edge or Chrome. I am running the latest version of Canvas Collections (v. 1.25), and the latest version of TamperMonkey (v. 5.10)

Additional context Coincidentally, Instructure/Canvas, on April 10, 2024, announced an update to JQuery. I don't know if the change impacts Canvas Collections, but it's a recent backend change by Instructure. See their latest update message: on this

Admin Role Updates Apr 10 jQuery is updated to version 3.5. Additionally, jQuery migrate 1.4 is replaced with 3.4.1.

Thanks in advance for your help.

djplaner commented 6 months ago

G'day,

Thank you for the bug report. Very useful. Especially since I'm not regularly using Collections myself at the moment.

With some exploration (described below) I've identified a couple of issues, including one echoing your problems.

I'll start looking at them separately and get back to you ASAP.

Exploration

The following is my attempt to re-create the problem you've reported. All the following are being done with FireFox and my test courses on "Canvas for Teachers"

Course with existing Collections configuration - working

A quick initial test and Collections still works as expected.

Emulate new course by renaming Collections configuration - unexpected behaviour

All of the Canvas course sites I currently use already have Collections configured. Historically I've renamed or removed the configuration page to emulate starting afresh with Collections.

This is not working as expected. Collections keeps working when the configuration page is renamed. I need to remove all content from the configuration page to make it approach expectations. Suggesting something has changed.

Experimenting further reveals

Now time to delete the configuration page and try again

Raising the question if this happens in a course that's never had Collections configured?

Create new course and configure Collections

djplaner commented 6 months ago

A quick update on progress. I've identified the cause of the problem (at least the one I'm having) and have started implementing fixes. Will look to finish these tomorrow (my time) if not before.

The problem (at least in my testing) does not arise in courses where Collections has never been used before. Only in courses where a Collections configuration page was created, but subsequently removed/renamed. There is a chance that courses with content copied from another course may have this problem.

This is arising due to the change in page names/page slugs from last year. This time impacting the configuration page. Collections was modified to handle this change on the lock page, but apparently not the configuration page.

djplaner commented 6 months ago

Some progress...more like 2 steps forward, 1 step back.

I've updated the Limitations page on the Collections' site with my current understanding of his particular problem, including a potential solution.

In short, I believe this problem is evidence of a course site where the Canvas Collections configuration page has been deleted or removed. Once this is done, any subsequent attempt to use Collections exhibits the issues you've reported. This is due to the change by Canvas I mentioned earlier.

It will be interesting to see if this is the situation you are facing and if the proposed solution will work?

What's next?

I will make some changes to Collections to detect this issue and provide a in-context solution.

Sadly, due to how Canvas works Collections can't be modified to avoid the issue. A modification that worked for the "edit lock" page will not work for the configuration page. This is because only teaching staff need access to the edit lock page. Both students and teaching staff need access to the configuration page. The solution for the edit lock page requires that the Pages course menu item is visible/accessible to students. Which is not always the case.