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

Allow overriding comment template from child class.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.9.3
    • Fix Version/s: None
    • Component/s: Comments
    • Labels:
      None
    • Affected Branches:
      MOODLE_29_STABLE

      Description

      The comment class (comment/lib.php) has a property 'template' which stores the comment display template. Currently the only way to modify the template from a plugin is by a plugin callback. However in some relevant cases the plugin callback may be too cumbersome for the desired effect. It may be much easier to manage the plugin comments by extending the comment class. But the visibility of the template property is private and as such it cannot be modified from a child class.

      The proposal here is a minimal change of the visibility of the template property from private to protected.

      From

          private $template;
      

      to

          protected $template;
      

        Attachments

        1. 28.png
          28.png
          45 kB
        2. 30.png
          30.png
          54 kB

          Activity

            People

            Assignee:
            itamart Itamar Tzadok
            Reporter:
            itamart Itamar Tzadok
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: