-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
5.0
-
MOODLE_500_STABLE
-
mdl-83224_main
-
The course format get_view_url() function currently uses the navigation option to specify whether to display the course main page or a section page, or the sr (section return) option to specify which section's page to display.
The sr option has always been problematic, because it depends on section numbers, which can change, directing the user to the wrong page. A more recent problem is that, historically, a value of 0 has been used to specify the course main page, but as the General/0 section can now be displayed on its own page, a value of 0 is now used to specify the General/0 section page, leaving no value to specify the course main page. This has been addressed by having the course main page, instead of the course's preferred page, be the default. This, in turn, has caused a problem for courses set to display sections on their own page, as the user would not, by default, be sent to the section page. This has been addressed by specifying, when generating links, that the user should be directed to the section page, which has shifted the problem to courses set to display all sections on one page, where links now direct users to section pages instead of the course main page.
Meanwhile, the navigation option, which specifies whether to display the course main page or a section page, is no longer sufficient, because there are now 3 levels of page to display: the course main page, a regular section page, or a subsection page.
Also "permalinks" have been added, which use section IDs in the links. These are currently hard-coded, instead of being generated through the get_view_url() function, which would allow course formats to provide appropriate links using the existing method for customising links.
This is addressed by adding 3 new options to the course format get_view_url() function:
pagesectionid replaces sr (section return), specifying the section ID of the page to go to, instead of the section number, and restoring the use of 0 to mean the course main page, allowing the previous get_view_url() default behaviour, of displaying courses' preferred page by default, to be restored.
pagelevel replaces navigation, specifying what page level to go to, course main page, regular section, page, or delegated/subsection page, plus options for the page of the specified section, and the page of the section containing the specified one (the last of which may be useful for nested course formats).
(The names of these two options are selected to express the commonalities and differences between them. Both act to select the course page to view. One does so by specifying the section ID for the page, and the other by specifying the level of the page.)
permalink is added, to allow the get_view_url function to handle the customisation of permalinks.
In addition, the facility has been added to use the pagelevel (navigation replacement) option to specify the section to return to, instead of the pagesectionid (sr/section return replacement) option, further improving the reliability of section return, by ensuring the user is returned to the correct section, even if the subsection or activity they were editing is moved.
- has a clone
-
MDL-83225 The user can be returned to the wrong page after editing a section or activity
-
- Closed
-
- has a non-specific relationship to
-
MDL-83308 Remove course get_view_url() navigation and sr options
-
- Open
-
-
MDL-80756 Deprecate get_view_url() function
-
- Reopened
-
-
MDL-83233 Don't assume the user wants subsections on separate pages
-
- Development in progress
-
- has to be done after
-
MDL-83307 Section return issues
-
- Waiting for peer review
-
-
MDL-83306 Book section return fix
-
- Closed
-