Open djplaner opened 5 months ago
CollectionsDetails::requestCollectionsPage
responsible for getting the configuration page it is implementing
const theUrl = `${this.baseApiUrl}courses/${this.config["courseId"]}/pages/canvas-collections-configuration`
i.e. it's not looking for multiple different versions of page names.
The code to retrieve the editing page lock uses CanvasSetup::getPageTitle
which is focused on getting the most recent page matching the page title - not the page slug.
requestCollectionsPage
to use getPageTitle
Part of the challenge will be the difference in approach
getPageTitle
accepts a call back requestCollectionsPage
uses a "then" to deciderequestCollectionsPage
that appears to work after some kludging
This issue (Canvas page name change resulting in multiple pages with the collections configuration page name) creates some other issues with Collections, including
[x] "Unpublished" link in main component links to the original slug/page title rather than the one actually being used
Modified to use the html_url returned from reading, which is saved in configStore[configPageUrl]
CollectionDetails::saveCollections
hard coded to save back to the specific slug -- CanvasCollections::completeInitialiseConfigPage
ahrded coded in HTML -- alsoCanvasCollections::startSaveCollections
CollectionsDetails::saveCollections
CollectionsDetails::generateConfigPageContent
CanvasCollections::completeSaveCollections
Of course, because this relies on the pages being visible to students.
There is no alternate for students - at least in canvas.
An alternative might be to use Canvas API to manually try each -X extension, but that could result in 100s of API calls - simply not sustainable.
CanvasSetup::getPageName
should return an error if it doesn't exist. Perform this at steps when the file should already exist (very early in staff view??)When teacher needs to create a new configuration page, before showing the "Canvas Collections is now on" dialog do a check to see if the page can be retrieved and/or check the status of this process and display an error that links to the limitations update
Thanks for your hard work trying to figure this out, Mr. Jones.
Here is something that occurred to me, though: might this new wrinkle in how Collections is behaving impinge on the ability to copy courses that use Canvas Collections (e.g., from semester to semester/term to term)? I hate to add to your list on this issue, but it would be an additional snag, if course copying was stymied.
I'll leave you to it and wish you success on this.
Hi @omachado-id,
Always happy to hear new suggestions for Collections. No matter when. Please do send any through.
I had wondered about potential issues with the copy process. However, I've just tested it (once) and it all worked as expected. A key point, however, is that this test was copying into a brand new course. It had never had Collections in it ever. All worked as expected. The normal Collections course copy process worked as expected.
Based on my current assumptions about this issue, I wonder if your tests were a bit like those I've done before. I tended to reuse the same set of sandbox course sites for all my testing. Deleting pages and other content for each new test. Given the Canvas change to pages, this process would no longer work. Canvas would always remember the original Collections configuration page.
David.
Collections must use the configuration page with the slug "canvas-collections-configuration". Just after Collections creates an initial config page, check that it is using this slug. If not, generate an error and point user to the documentation.
CanvasCollections::turnEditingOn
will detect noCollectionsConfig
and display alert. Modify this to point to documentation/explanation.
CanvasCollections::initialiseCollections
appears to do the initial set up. It calls collectionsDetails::saveCOllections
to create the page -- does it test if it's created?
saveCollections
to check saved page URL for the proper slugCollectionsDetails::initaliseCollections
doesn't check result of collectionsDetails::initialiseCollectionsConfig
before setting noCollections to false
A call to gotCollectionsDetails is perhaps too early?????????
That's because it doesn't save it.
CollectionsDetails.saveCollections
needs to check for creating correctly. But it's not even being called
The editingOnHandler is being created for every user, but. not needed for student. Leave for now.
Mr Jones, I appreciate your willingness to consider new features, even as you stamp out this vexing issue (which I have no doubt that you will, given how you're zeroing in on the error inducing settings). I'll collect my thoughts on the feature musings I've had, and post them at a later time.
BTW, I think your observation that you and I may have been relying on the same set of sandboxes for our testing is spot on. There are hefty courses that I've built with Canvas Collections that continue to work just fine, and then there are the ones throwing the errors, and those are sandboxes. For whatever arcane reason, they refuse to work with Collections now. Canvas does seem to be "remembering" their original Collections settings, even though I've deleted all the previous config pages. Could Canvas be doing this through its content undelete features (where one can "undelete" previously deleted content, for up to several days after the deletion? No other idea comes to mind, unfortunately.
About to release a 1.3 update to Collections.
This version introduces the previously deleted configuration page check.
When Collections is used with a course site where the Collections config page has been deleted, you will need to turn Collections on. Turning it on checks for this problem and displays a dialog warning which links to the online help. Which details a possible solution.
However, due to the limitations of the Canvas "undelete" feature (it only shows recently deleted items) the solution is not 100% usable. Particularly when using "sandbox" course sites
Thanks for the hard work, Mr. Jones; I'm now using v. 1.30.
As you pointed out, sometimes the new update may not work, if the reported issue occurs. I tried it on the two courses that know were giving me the problem. Version 1.30 allowed me to use Collections in one of them again. And one did not, due to the limitations of the undelete feature, which you mentioned. On a side note,
On the one that worked, I noticed the Collections turned itself off automatically very quickly again (recall that you had fixed that issue in one of my earliest reports on this forum). Could you double-check what the auto-turnoff time limit is on new version 1.30 (just in case the code reverted to the old short turnoff time limit)?
Regarding the course, which was refusing to allow me to reactivate Collections even with version 1.30, I think that I've resolved the issue sufficiently that I was able to activate Collections again. However, I'll have to redo any Collections editing I may have lost with this workaround solution (minimal, I believe).
First, my attempts to use "undelete" to find the one correct "old" config page that I could restore, after I'd deleted it months ago, and which would allow me to reactivate Collections, failed. (It was too long ago and there were so many newer deleted config pages within the last few days, that it wasn't possible to go that route.) Next, I considered resetting the course to a blank state, but that seemed like an irrevocable "nuclear option" to me, so I passed on that idea.
A few moments ago, I followed a hunch and did the following:
While these steps above allowed me to reactivate and begin using Collections in this troublesome course, it may not be a solution for everyone, because:
So the net result is that the troublesome course is practically as good as new--at least in this case--and Canvas Collections is once again usable within it.
I hope this helps others.
Describe the bug
Related to #297. If a course has been previously configured with Collections - but the configuration has been removed/renamed - it appears impossible to get back to editing.
To Reproduce
(Optional requirement) Turn off the Collections browser extension
Go to a Canvas course with Collections configured
Remove the Collections configuration page
Reload the modules page
The collections widget appears with the on switch
Turn it on
canvas-collections-configuration-_x_
where x is some numberHit the "Edit on" button to enter edit mode
Collections shows "failure" dialog - couldn't find collections configuration
Expected behavior
Edit mode should operate with a fresh/empty configuration
Observed errors
Developer logs are showing a 404 error when trying to get
canvas-collections-configuration
which is being called fromCollectionsDetails.requestCollectionsPage
Suggesting that it's not handling the
-x
extension being added apparently related to this known Canvas change which apparently had been fixed???