Fixes renderers.php for the missing 'numsections' issue

Issue #728 resolved
Jeremy Hopkins created an issue

There is an outstanding pull request to assign variables that seem to have been lost from core:

https://bitbucket.org/covuni/moodle-theme_adaptable/pull-requests/43/fixes-renderersphp-for-the-missing/diff

That pull request only adds them in one place, I believe there are at least two functions within renderers.php which would require this change if done at that level.

I am not sure if doing it repeatedly within functions is the best approach but it would be acceptable to do it that way unless they could be assigned when the theme loaded as opposed to being applied by multiple functions.

Comments (5)

  1. Manoj Solanki

    Just looking at this. The issue appears (I believe) on 3.3 where the numsections class variable no longer exists. See screenshot below. numsections issue issue 728.png

  2. Jeremy Hopkins reporter

    Yes that is the case, it is missing from 3.3 so we need to put it in the theme for now.

  3. Manoj Solanki

    I've looked at the code in the pull request and I've done a solution in renderers.php partially using this. I've created a "get" method in the trait single_section_page for number of sections and then called that in the two places where it was previously referencing $course->numsections. It's also expandable should this information be needed by anything else. By doing this we can remove reference to $course->numsections . It could cause further confusion going forward if we keep using it and think this approach maybe more futureproof? Will check this into my branch for review.

  4. Log in to comment