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

Using the email_to_user() function causes Behat to fail

XMLWordPrintable

    • MOODLE_26_STABLE

      I'm using the email_to_user() function to send out emails to students and this error pops up when the function is triggered as part of a Behat step:

      Notice: Undefined index: utf-8 in /Users/matt/code/moodle26.dev/docroot/lib/typo3/class.t3lib_cs.php line 1109

      It is part of a cron function, which the step calls directly. I have tried setting the parameters to empty strings for the email subject, text and HTML, but it makes no difference.

      Looking at that code, the typo3 library seems to be badly written in that it calls is_array() on an array index that may not have been initialised, so the notice is accurate:

      if (is_array($this->toASCII['utf-8'])) {

      However, I cannot work out what the solution is. Initialising the ascii cache by adding the following line at the top of the textib class causes a different error:

      $typo3cs->initUnicodeData(); // Line 104 of /lib/classes/text.php

      Notice: Uninitialized string offset: 10 in /Users/matt/code/moodle26clean.dev/docroot/lib/typo3/class.t3lib_cs.php line 2116

      I'm out of ideas so I'm going to try to bypass the function altogether and use another way to send emails.

            Unassigned Unassigned
            mattgibson Matt Gibson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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