Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-3102

Make CoreMainMenuDelegate handlers optional without throwing an exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 3.7.1
    • 3.7.0
    • Site add-ons
    • Hide

      This issue should only be tested in 1 device.

      1. Install the plugin attached to this issue in a site with MDL-66229 applied, in the local folder.
      2. In the app, login in that site and open any course. Check that you don't see "My awesome plugin" option in the top tabs.
      3. Now edit local/courseoptiontest/classes/output/mobile.php and remove the "javascript" return from the "init" function.
      4. Restart the app and open any course. Check that now you see the "My awesome plugin" in the top tabs.
      5. Edit local/courseoptiontest/classes/output/mobile.php and in the init function add a new field to the return: "disabled" => true.
      6. Restart the app and open any course. Check that now you don't see the "My awesome plugin" in the top tabs.
      Show
      This issue should only be tested in 1 device. Install the plugin attached to this issue in a site with  MDL-66229 applied, in the local folder. In the app, login in that site and open any course. Check that you don't see "My awesome plugin" option in the top tabs. Now edit local/courseoptiontest/classes/output/mobile.php and remove the "javascript" return from the "init" function. Restart the app and open any course. Check that now you see the "My awesome plugin" in the top tabs. Edit local/courseoptiontest/classes/output/mobile.php and in the init function add a new field to the return: "disabled" => true. Restart the app and open any course. Check that now you don't see the "My awesome plugin" in the top tabs.
    • Hide

      Any handlers that may throw an exception in their init web service function must be defined in a plugin type other than a course format.

      Show
      Any handlers that may throw an exception in their init web service function must be defined in a plugin type other than a course format.
    • MOODLE_37_STABLE
    • MOODLE_37_STABLE
    • Moodle App 3.7.1

      Since MOBILE-2800, if handlers defined in a course format plugin do not initialise, courses using the format are not accessible in the app.

      If you have a CoreMainMenuDelegate handler defined and you want to make its display optional, you have to have its init function throw an exception.  If the handler is defined in a course format plugin, this exception will make the app think the plugin's handlers have not initialised, and the courses will be inaccessible.

      To get around this, we need a way to make these handlers optional without throwing an exception in the web service, like we do with the "restrict" array for other handler types.

       

            dpalou Dani Palou
            marxjohnson Mark Johnson
            Mark Johnson Mark Johnson
            Juan Leyva Juan Leyva
            Albert Gasset Albert Gasset
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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