Moodle
  1. Moodle
  2. MDL-26875

No 'View all courses' entry in AJAX-built navigation block category list

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.0.3
    • Component/s: Navigation
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      16859

      Description

      When a category has >=20 courses in it and the user navigates down the category tree, no "View all courses" link is included for a category if the data for the subtree is being fetched using AJAX requests. For comparison, when the tree is built at page render time, for example if a course within one of these categories is being viewed, the "View all courses" link is there.

      The patch at https://github.com/jonof/moodle/commit/c683165a4ad0a15f925d44d48dd393cd2abb509b implements a solution for this problem.

      There is already code in blocks/navigation/yui/navigation/navigation.js in the addChild() function that adds the 'view all courses' link if a category was passed in, but this code is never run because the loop in ajaxProcessResponse() is calling addChild() for each course entry. To reduce redundancy I moved this code to a new function that is called by addChild() and ajaxProcessResponse().

        Activity

        Hide
        Sam Hemelryk added a comment -

        Thanks Johnathon, I've created PULL-482 to see your fix go into core.
        It will be reviewed for integration on Monday and providing it passes that review and testing it will be in the Weekly that gets released on Wednesday.

        I should add that I did make 2 small changes to your patch before requesting integration.

        1. I moved the node type test into the object test just to be safe.
        2. I moved the JS string inclusion call from lib/navigation lib into the navigation block code where the navigation is actually being initialised.

        Cheers
        Sam

        Show
        Sam Hemelryk added a comment - Thanks Johnathon, I've created PULL-482 to see your fix go into core. It will be reviewed for integration on Monday and providing it passes that review and testing it will be in the Weekly that gets released on Wednesday. I should add that I did make 2 small changes to your patch before requesting integration. I moved the node type test into the object test just to be safe. I moved the JS string inclusion call from lib/navigation lib into the navigation block code where the navigation is actually being initialised. Cheers Sam
        Hide
        Helen Foster added a comment -

        Confirming that this issue is fixed in this week's 2.0.2+. Thanks Jonathon and Sam.

        Show
        Helen Foster added a comment - Confirming that this issue is fixed in this week's 2.0.2+. Thanks Jonathon and Sam.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: