Non-admin view of Legacy Files in 3.7
Number of replies: 18Apologies that I did double post this. I thought perhaps I had not initially posted it in the most appropriate forum.
I recently upgraded to 3.7 and for some reason legacy files don't seem to be working as they did in all previous versions. As an admin I can see all files displayed on an html page (images, rendered css etc) that are stored within legacy files, but any non-admin user cannot (teacher, student, etc). It seems like this would be a permissions change but I'm unable to find any user permission related to this. I thought perhaps too it was related to the theme but I tested this again a clean MAMP site and had the same results. Any recommendations/solutions? Thanks!
Re: Non-admin view of Legacy Files in 3.7
Upgraded from what Moodle version to 3.7.highest and how?
See your sites:
admin/settings.php?section=managerepositoriescommon
With editing turned on do you see a Legacy Files anywhere in the 'Gear' drop down?
When in a course, do you see any link to "Legacy Files" in course admin menu or under 'Gear' icon drop down/more?
'SoS', Ken
Re: Non-admin view of Legacy Files in 3.7
Follow up ... grrrr ... posting timed out while I was looking up stuff ...
In your sites: admin/repository.php
Is Legacy Course Files enabled and visiable?
and ...
https://docs.moodle.org/37/en/Legacy_course_files
'SoS', Ken
Re: Non-admin view of Legacy Files in 3.7
Thanks for the reply. In Site administration > Plugins > Repositories > Common repository settings I have both Legacy course files in new courses and Allow adding to legacy course files enabled. When I go to the course legacy files is visible in the admin block. As an admin I can both see the files displayed as intended in the course as well as browse to the files. Teachers/students do not see any of the files within the course.
The site is currently on Moodle 3.7.2+ (Build: 20190913). I upgraded from 3.5. Due to institutional security settings the upgrade was done by copying the site to a cloud server, upgraded, and then pulled back down into the secure environment. This is the process we've used for the last two upgrades and it's worked thus far. Let me know if you want more detail on the upgrade or if I didn't answer something specific.
Thanks again!
Re: Non-admin view of Legacy Files in 3.7
Go to
Site administration
Users
Permissions
Check system permissions
Select a student or teacher account
Click Show this user's permissions
Filer 'files'
What's setting for:
Repository: Legacy course files
Use course files repository pluginrepository/coursefiles:view
Highly recommend getting site/courses away from 'legacy' files. Once a course is in 'legacy' it's in legacy forever! :\
Unfortunately, there is no admin plugin of which I am aware that would do courses en mass.
There used to be a plugin for TinyMce editor called 'poof' which would change legacy files into moodle's new file system. But one had to visit each resource (link to file).
You could try using something created ... clipoof ... which works on a backup of a course that has legacy files - a bash shell script.
https://sos.sosoftexas.org/scripts/clipoof/
Requires making full user backups of courses (each course) and use on a linux server or Mac. Once the backup is rebuilt, backup is restored to a new course.
I have used it myself and for the most part it works.
Unless some Moodle developer has a better method ...
'SoS', Ken
Re: Non-admin view of Legacy Files in 3.7
Thanks again for your reply. I chose on teacher and found the Use course files repository plugin repository/coursefiles:view is set to No. However, when I went to Site administration > Users > Permissions > Define roles and selected teacher it is set to Allow there. Is there a different setting I need to adjust?
Agree changing for all student and teachers manually would be time prohibitive. Was there a change in 3.7 in this permission? I didn't see any but entirely possible I overlooked it. I wonder if reverting versions would correct it as a temporary fix allowing us to migrate away from Legacy.
Also agree moving away from legacy files is the ideal course. Matter of time and money, but using the process you describe does make it seem more achievable.
Thanks again Ken
Tiffany
Re: Non-admin view of Legacy Files in 3.7
I suggested selecting a single teacher or student account to see what those account settings were.
Now you need to go to the student and teacher roles (site wide) themselves and make the same additions you did for the one teacher/student.
Setting for student/teacher site wide roles would apply to all accounts on the system that are student/teacher.
Make a backup of one of the courses with legacy. Try the clipoof script. Restore that course to a hidden category and hide the restored course. Admins can still see all in there. Turn off legacy in that course and test every link to a file.
Afraid there is no easy way to get courses out of legacy.
As far as reverting your site back to previous version ... yes, that's "quick fix" ... but the courses in that version of Moodle that legacy will still be in legacy. Just avoiding the inevitable for a while.
Comment/thought ... if courses are in legacy they must be very old - wonder about the age of the content therein?
Hmmm ... how many planets do we have now?
Might be perfect time for those courses to be rebuilt forcing teachers to consider different/tools/ways ... improving their online delivery and assuring that none have out-of-date or incorrect info from what is accepted today.
My 2 cents, of course!
'SoS', Ken
Re: Non-admin view of Legacy Files in 3.7
Yes, I choose a single teacher and found the Use course files repository plugin repository/coursefiles:view is set to No.
When I went to the teacher role sitewide the repository plugin repository/coursefiles:view was already set to Allow. Unless I'm misunderstanding the permission, that is way the setting should be, correct?
I'll give clipoof a shot.
Agree reverting is just a delay. Unfortunately due to funding restrictions updating the file structure may be prohibitive. The content does get updated, but not the file structure portion. We are using css in legacy files and that appears to be the largest issue-Content displays but not within the css. Agree there are better more up to date ways to manage this, but again, funding restrictions. Perhaps though this will help to move that conversation.
Thanks again!
Re: Non-admin view of Legacy Files in 3.7
There's site wide and then there is individual.
Could be that one teacher checked had the issue.
Check more than one teacher - multiple.
Same with student(s).
Hmmm ... 'legacy in css' ... sounds like SCORM's. If that's true, then were the SCORM packages uploaded to a file system repo, unzipped there, and then in Moodle when setting up a SCORM, the link to the manifest xml file was 'aliased'? (which, I think leaves the SCORM files where they are but Moodle allowed to view). Checking moodledata/repository/ for unzipped SCORM's might verify that.
Don't think I'd be looking for a fix for this coming from Moodle HQ ... legacy has been there since 1.9->2.x days.
As far as time/cost ... also sounds like that's something internal to your entity.
Anyhoo ... looking in the right spot ... now a matter of figuring out what to do about it. And that is totally your call!
'SoS', Ken
Re: Non-admin view of Legacy Files in 3.7
1. I checked multiple individual teachers via check permissions in system. For all that I have checked they say Repository: Legacy course files=No. When I check those same teachers permissions in the course (Course > Users > Permissions > Check permissions) they say Repository: Legacy course files=Yes. When I go to the sitewide settings for the teacher role it shows repository/coursefiles:view it is set to Allow.
2. There is no way that I see to change that permission from yes to no on the check permissions either at the site admin level or the specific courses. The only way I know to change this permission is via the system wide settings. If there is a way that I'm not aware of though that would be great.
3. I checked several multiple students via check permissions in system. For all that I have checked they say Repository: Legacy course files=No. When I check those same students permissions in the course (Course > Users > Permissions > Check permissions) they say Repository: Legacy course files=Yes. When I go to the sitewide settings for the student role it it is set to Allow.
Agree this is all less than ideal and I don't expect a fix--I'm just looking for a way to patch this together to buy me time time while I fix it correctly. Appreciate you taking your time.
Thanks again
Re: Non-admin view of Legacy Files in 3.7
Well, I am confused then ... thought something turned on site wide (an allow) for a role would mean in a course the same ... allow ... unless one does an 'override' at the course level.
You need both teachers and students to see Legacy Files. So in both role definitions should have, repository/coursefiles:view is allow.
'SoS', Ken
Re: Non-admin view of Legacy Files in 3.7
Took a course from another server that was using legacy.
Restored to a 3.7.highest sandbox.
In order for student role to see Legacy SCORM's in the course had to set to allow the item below.
Default student role permissions had Not Set.
Originally set as the image shows:
Notice NOT set ... Set it to allow.
Check Teachers role definitions as well and do same.
'SoS', Ken
Re: Non-admin view of Legacy Files in 3.7

Re: Non-admin view of Legacy Files in 3.7
Have you been purging caches after changes and making sure session files have been removed from moodledata/sessions/
So debug shows nothing? How about FireFox tools?
Am really at a loss here! :\ Sorry!
'SoS', Ken
Re: Non-admin view of Legacy Files in 3.7
Follwup ..... discovery ... after restoring a course that had legacy files successfully on a 3.7.highest sandbox, got an email from the 3.7 system on status of automated backups.
Error ... on the legacy course I restored without error ... missing was collapsed-topics. Hadn't installed that course format in the 3.7 sandbox.
There was an item in config of collapsed-topics for "legacy files'.
So ... by chance ... does your server have any course formats that might need updating?
IF not ... then I truely have come to the end of the road here!
'SoS', Ken
Re: Non-admin view of Legacy Files in 3.7
Re: Non-admin view of Legacy Files in 3.7
So, like me, a missing course format caused issues with Legacy files viewing?!!! Whoda thought? ... Answser: NO ONE!
One of "Moodle Mysteries" I guess!
But ... good! glad to hear it! Congrats!
Virtual Finger wag: now get rid of Legacy before any upgrade! end_wag!
'SoS', Ken
Re: Non-admin view of Legacy Files in 3.7
Thanks again
Re: Non-admin view of Legacy Files in 3.7
How does one reverse a virtual finger wag?
Truth ... and a request ... if you discover a sure fire way to convince a 'customer' that Legacy Files are 'evil', please do let me know!
Have been working on/with a customer now for 10 years and have not been successful in convincing. With each update/upgrade performed I wonder when it's gonna 'hurt' and 'customer' won't be happy! (although 'customer' might listen next time).
So 'virtual finger wag' back at me! :|
'SoS', Ken