You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, old URLs from the URL history only work when there are spaces ' ' instead of '+' signs. For example, let's say:
Course with shortname "My Course" has clean url: http://www.example.com/moodle/course/My+Course
Shortname is changed to "My Cool Course". Upon saving this edit, it loads the page with the old URL since it is cached, so still: http://www.example.com/moodle/course/My+Course
Purge all caches so that on the next try, it will need to load from the URL history in the database.
The old URL should still load since it is in the URL history. But trying to load http://www.example.com/moodle/course/My+Course results in "Sorry, the requested file could not be found".
Change all '+' signs to spaces ' ' (http://www.example.com/moodle/course/My Course) and the page loads fine, redirecting to the new clean URL: http://www.example.com/moodle/course/My+Cool+Course
Notes:
Same behavior applies to course modules, since course module URLs have the course URL in them.
The most current URL works, regardless of whether there are spaces ' ' or '+' signs. Only loading of old URLs with '+' signs don't work.
The database stores clean URLs without the '+' signs. This is probably why only old URLs without '+' signs work.
The '+' signs come from cleaning URLs using the urlencode() function in classes/local/cleaner/cleaner.php.
Is there any reason why clean_moodle_url::sluggify() is used only to clean some paths, and urlencode() is used for others? Wouldn't it be better to keep everything consistent with sluggify()?
The text was updated successfully, but these errors were encountered:
Currently, old URLs from the URL history only work when there are spaces ' ' instead of '+' signs. For example, let's say:
http://www.example.com/moodle/course/My+Course
http://www.example.com/moodle/course/My+Course
http://www.example.com/moodle/course/My+Course
results in "Sorry, the requested file could not be found".http://www.example.com/moodle/course/My Course
) and the page loads fine, redirecting to the new clean URL:http://www.example.com/moodle/course/My+Cool+Course
Notes:
urlencode()
function inclasses/local/cleaner/cleaner.php
.clean_moodle_url::sluggify()
is used only to clean some paths, andurlencode()
is used for others? Wouldn't it be better to keep everything consistent withsluggify()
?The text was updated successfully, but these errors were encountered: