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

Mustache_Exception: Unknown helper: uniqid

XMLWordPrintable

    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_33_STABLE, MOODLE_35_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE, MOODLE_402_STABLE
    • MOODLE_402_STABLE, MOODLE_403_STABLE
    • MDL-59467-403
    • MDL-59467-main
    • Hide
      1. Ensure that xdebug is enabled
      2. Open /my/index.php in your editor
      3. Add xdebug_break(); to the top of the file
      4. Ensure that your IDE Is configured to listen for xdebug
      5. Ensure that the Exceptions breakpoint is checked
      6. Log in to Moodle
        1. *Confirm that xdebug stopped at (or the next code line after) the xdebug_break(); line at the top of /my/index.php
      7. Continue
        1. Confirm that there were no more breakpoints activated
      Show
      Ensure that xdebug is enabled Open /my/index.php in your editor Add xdebug_break(); to the top of the file Ensure that your IDE Is configured to listen for xdebug Ensure that the Exceptions breakpoint is checked Log in to Moodle *Confirm that xdebug stopped at (or the next code line after) the xdebug_break(); line at the top of /my/index.php Continue Confirm that there were no more breakpoints activated

      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.

        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

            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

              Created:
              Updated:
              Resolved:

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

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