Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-82767

Implement a non ajax alternative for the course edit action

XMLWordPrintable

    • 3
    • HQ 2024 Sprint I4.3 Moppies

      Since 4.0, many course actions had a non-ajax alternative. It uses the "course/mod.php" URL for modules, but for sections, it is directly implemented in "course/view.php". However, this implementation presents some problems that could benefit from being replaced by a new one:

      • Not all post-4.0 course edit actions are compatible, and they can be easily added.
      • Each action has its get parameters, which introduce complexity that can be avoided using the same parameters as the post-4.0 core_courseformat_update_course webservice.
      • All new course actions are now centralized in the core_courseformat\stateaction class. However, those files still use the old course/lib.php methods and ad-hoc code.
      • The file is located at core_course, but it would be much better if it were located under the core_courseformat folder because it relates to this subsystem.
      • The code is old and has a lot of unnecessary code.
      • All section actions are implemented directly on course/view.php, which is currently a mess. Moving the actions to a separate file with a redirect will make everything easier to maintain.

      With all this in mind, the general idea will be:

      • Create a new course/format/update.php that receives the same params used in the core_courseformat_update_course webservice (courseid, action, cmid, sectionid, targetcmid and targetsectionid). The page can redirect to the course once the action is done and the code will be much simpler than the current one.
      • Replace all module and section action links with the new one.
      • Create an issue to remove the old code from course/view.php and course/mod.php in 6.0.
      • Replace the old course/view.php and course/mod.php by redirecting to the new URL and adding a deprecation message.

      When all of this is done, we can also:

      • Create an issue to create a behat step to execute actions directly into the course. The step will detect if javascript is enabled and decide whether to use the Ajax or the non-ajax version. This will accelerate some behat tests that only use javascript to perform a few course actions.

       

            tusefomal Ferran Recio
            tusefomal Ferran Recio
            Laurent David Laurent David
            Amaia Anabitarte Amaia Anabitarte
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 19 minutes
                1d 19m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.