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

"PHP Fatal error" when running 'moodle-plugin-ci mustache'

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.4.5
    • Local: Code checker
    • None
    • MOODLE_404_STABLE

      When executing the ci.yml workflow on GitHub, the following command:

      run: moodle-plugin-ci mustache

      generates the following error:

      PHP Fatal error: Uncaught Error: Object of class stdClass could not be converted to string in /home/runner/work/moodle-local_kopere_bi/moodle-local_kopere_bi/ci/vendor/mustache/mustache/src/Mustache/Cache/NoopCache.php(45) : eval()'d code:22
      Stack trace:
      #0 /home/runner/work/moodle-local_kopere_bi/moodle-local_kopere_bi/ci/vendor/mustache/mustache/src/Mustache/LambdaHelper.php(50): __Mustache_e7061c46f72baaec81c627bab4c9f71c->renderInternal() 

      The error does not indicate which .mustache file is causing the issue, making it difficult to identify the problematic file. To resolve this, I had to delete all .mustache files and upload them one by one until I found the file responsible for the error.

      Steps to Reproduce:

      Attached is the file test.mustache. Note that in the "Example context" block, the variable options comes from PHP, and I should have enclosed the example in quotes. However, since I didn’t, an exception occurs.

            moodle.com Moodle HQ
            eduardokraus Eduardo Kraus
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

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