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

We should not use statics for things that should only be output once. It needs to be tracked per-page

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.8
    • Component/s: HTML and CSS
    • Labels:
    • Testing Instructions:
      Hide

      Run all the behat tests. I hope that is a sufficent regression test.

      If you want to test manually:

      1. Turn editing on in a course, and verify that you can add an activity.
      2. Verify that the Toggle acitvity chooser link only appears once.
      3. Verify that the file-picker/manager works.
      4. Inspect the HTML, and verify that the HTML for these things are not output multiple times.
      Show
      Run all the behat tests. I hope that is a sufficent regression test. If you want to test manually: Turn editing on in a course, and verify that you can add an activity. Verify that the Toggle acitvity chooser link only appears once. Verify that the file-picker/manager works. Inspect the HTML, and verify that the HTML for these things are not output multiple times.
    • Affected Branches:
      MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      There are several places in our renderers where we have things that should only be output once. E.g. the contents on the mod chooser, when editin a course.

      At the moment, these are typically tracked using static variables, but that does not work becuase in some cases (e.g. unit tests) we may need to reset this within one script. It should be tracked per page.

      The place we track othre things like this is in page_requirements_manager. I am going to add an API there.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              timhunt Tim Hunt
              Reporter:
              timhunt Tim Hunt
              Peer reviewer:
              Andrew Nicols
              Integrator:
              Damyon Wiese
              Tester:
              Jetha Chan
              Participants:
              Component watchers:
              Amy Groshek, David Scotson, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Nov/14