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

CoreMainMenuDelegate handlers do not behave as expected

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. In a site with 3.5 or local_mobile, install or create a site plugin.
      2. In mobile.php, create a main menu handler and set a high priority (like 10000).
      3. In the app, login in that site. Check that the site plugin is not displayed in the bottom tabs, it is always in more menu.
      4. In web as admin, disable all the main menu features except the course overview.
      5. Back in the app, check that the site plugin is still displayed in more menu, not in bottom tabs.
      Show
      In a site with 3.5 or local_mobile, install or create a site plugin. In mobile.php, create a main menu handler and set a high priority (like 10000). In the app, login in that site. Check that the site plugin is not displayed in the bottom tabs, it is always in more menu. In web as admin, disable all the main menu features except the course overview. Back in the app, check that the site plugin is still displayed in more menu, not in bottom tabs.
    • Workaround:
      Hide

      To force your button into the More tab, you can add some dummy CoreMainMenuDelegate handlers with no icon and a higher priority that then one you want in the More tab, then add a CSS rule with pointer-events: none that will apply to these dummy buttons.

      Show
      To force your button into the More tab, you can add some dummy CoreMainMenuDelegate handlers with no icon and a higher priority that then one you want in the More tab, then add a CSS rule with pointer-events: none that will apply to these dummy buttons.
    • Affected Branches:
      MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE
    • Sprint:
      Moodle Mobile 3.6.0

      Description

      The documentation for CoreMainMenuDelegate states "Main Menu plugins are always displayed in the "More" tab, they cannot be displayed as tabs in the bottom bar."  However, in some cases the opposite is true.

      If you disable some of the items from the main menu in your Moodle site's Mobile Features settings (We have everything except for "My websites" and "Web page" disabled), and have a plugin which adds an item to the main menu, it will always display in the bottom bar.  Changing the priority of the handler will change the position of the icon, but only within the bottom bar - there is no way to make it display in the More tab as described unless you already have 5 icons displayed in the bar.

      This is problematic as the behaviour of your handler's page has subtle differences depending on whether its displayed in the bottom bar or the More tab.  For example, the label is not displayed with the icon in the bottom bar, which you may want, and the "Back" behaviour is not the same in both cases.

      From our point of view, this should either work as described in the documentation (never display custom items in the bottom bar), or there should be an option in the handler to display in the bottom bar if possible, or always display in the More tab.

      In addition, even when using the workaround above, we had problems with the priority setting to control our item's position within the 'More' menu. Regardless of priority setting, the item appeared at the top of the menu.

        Attachments

          Activity

            People

            Assignee:
            dpalou Dani Palou
            Reporter:
            marxjohnson Mark Johnson
            Peer reviewer:
            Pau Ferrer
            Integrator:
            Juan Leyva
            Tester:
            Pau Ferrer
            Participants:
            Component watchers:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              11/Jan/19