brendanheywood / moodle-local_cleanurls

Lets drag Moodle's url structure into this century...
37 stars 24 forks source link

After implementing Section Cleaning, section 0 (general / root section) is inacessible. #101

Open roperto opened 7 years ago

roperto commented 7 years ago

A course module in 'section 0' becomes cleaned as:

https://moodle/course/Daniel/general/2-sw-ipsum when I expected https://moodle/course/Daniel/2-sw-ipsum

and then it cannot be uncleaned.

brendanheywood commented 7 years ago

There is two ways we can tackle this:

1) we try and do this the right way so that the url is just:

https://moodle/course/Daniel/general/2-sw-ipsum

I'm not sure how well that fits into the format cleaner architecture you've built. If it's a pain to sturctural fix then a workaround is to clean it and unclean it with some simple url like this:

https://moodle/course/Daniel/-/2-sw-ipsum

Note this may also be an issue with course formats like scorm or social where the entire course is in one section 0

roperto commented 7 years ago

I am not sure about scorm, but because they are handled by the format they would probably just share the same URL as the course if they are like singleactivity format.

When talking about simple formats (no nested sections), the idea in (1) should work fine, unless we have another section called 'general' then it could conflict. It is implemented at format level so we are very flexible to the way we think its best.

When using nested sections I particularly dislike the idea (1) as it would prepend all sections with the 'general' word.

IMO the section 0 is a root section, at least for topics and similar formats its name is not really displayed, so I believe just 'ommiting' them could be an option instead of using the name general, for example https://moodle/course/Daniel/2-sw-ipsum. This would look nice especially when we are cleaning course activity URLs, by adding course modules with customised URLs the course editor will have full control of the URL after the course name.

I'd suggest starting with the simple sections first, just let me know which address style you prefer. That will fix most of the related problems we have now, then we can think better about other formats (I can open an issue for each remaining format not working nicely).

Cheers,

Daniel