Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-5357

Instance store to manage stored instances of Dataform managers

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.7.3, 2.8
    • 2.6.5, 2.7.2
    • Set: Dataform
    • None
    • MOODLE_26_STABLE, MOODLE_27_STABLE
    • MOODLE_27_STABLE, MOODLE_28_STABLE

      The Dataform class and Dataform managers classes (e.g. field manager, view manager etc.) can store active instances during script runtime. In current implementation the instances are stored in a static variable inside a class::instance() method. Conseqently, stored instances cannot be cleaned up from the outside. While this may not have any particular effect in normal operation of the Dataform, it may pose a problem during testing where tests may be run in a group and the static array of instances might not be initialized at the beginning of each test.

      The proposed solution is to extract the instances management to a designated class 'instance_store' which will provide the api for registering, unregistering and retrieving an instance.

      Since all instances belong to a specific dataform, the list can be associative with dataform ids as keys. Manager instances reside in inner lists for each dataform id. This way, on deleting a dataform all stored instances can be cleaned up by unsetting the list entry of the target dataform.

            itamart Itamar Tzadok (Inactive)
            itamart Itamar Tzadok (Inactive)
            Itamar Tzadok Itamar Tzadok (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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