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

Mustache_Exception: Unknown helper: uniqid

    XMLWordPrintable

Details

    Description

      After update from Moodle 3.1.1+ to Moodle 3.3+ got mustache exception.

      It is only visible when PHP extension Xdebug turned on.

       ( ! ) Mustache_Exception_UnknownHelperException: Unknown helper: uniqid in C:\Server\home\moodle.test\www\lib\mustache\src\Mustache\HelperCollection.php on line 93 
      

       I use next patch:

      In file /lib/outputrenderers.php I added two rows into the method get_mustache:

      $uniqidhelper = new \core\output\mustache_uniqid_helper();

      And into $helpers array element 'unigid'

      $helpers = array('config' => $safeconfig,
            'str' => array($stringhelper, 'str'),
            'quote' => array($quotehelper, 'quote'),
            'js' => array($jshelper, 'help'),
            'pix' => array($pixhelper, 'pix'),
            'shortentext' => array($shortentexthelper, 'shorten'),
            'userdate' => array($userdatehelper, 'transform'),
            'uniqid' => array($uniqidhelper, 'uniqid'),
       );

       

      P.S.

      Moodle 3.3+

      Themes: Adaptable, BCU, Boost, Clean.

      Attachments

        1. bug_3.JPG
          bug_3.JPG
          336 kB
        2. image-2021-05-11-06-14-54-864.png
          image-2021-05-11-06-14-54-864.png
          47 kB
        3. MDL-59467.png
          MDL-59467.png
          870 kB
        4. pic1.JPG
          pic1.JPG
          70 kB
        5. pic2.JPG
          pic2.JPG
          364 kB

        Activity

          People

            dobedobedoh Andrew Lyons
            zhuikill Ilya Zhuykov
            Meirza Meirza
            Ferran Recio Ferran Recio
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            15 Vote for this issue
            Watchers:
            32 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours, 46 minutes
                5h 46m

                Clockify

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