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

Emailing attachment has reliance on $CFG->localrequestdir

XMLWordPrintable

    • MOODLE_310_STABLE
    • MOODLE_310_STABLE
    • Hide

      Ensure you have a test site with e-mail configured, or with a service such as Mailhog or Mailcatcher

      1. Please MDL-70163.php in your dirroot directory
      2. From CLI, execute it

        $ php MDL-70163.php
        

      3. Confirm no PHP warning is triggered
      4. Confirm you receive an e-mail containing a "Hello.txt" attachment containing the text "Test attachment"

      Automated tests

      1. Execute unit tests, confirm they still pass

        $ mdk phpunit -r -u lib/tests/moodlelib_test.php
        

       

      Show
      Ensure you have a test site with e-mail configured, or with a service such as Mailhog or Mailcatcher Please MDL-70163.php in your dirroot directory From CLI, execute it $ php MDL-70163.php Confirm no PHP warning is triggered Confirm you receive an e-mail containing a "Hello.txt" attachment containing the text "Test attachment" Automated tests Execute unit tests, confirm they still pass $ mdk phpunit -r -u lib/tests/moodlelib_test.php  

      Related to MDL-66928 and from recent fix to allow email attachments to be included from that directory in MDL-70130

      If calling code calls email_to_user and $CFG->localrequestdir hasn't yet been created (/tmp/requestdir on my system), then a PHP warning is generated:

      strpos(): Empty needle
       
      /mnt/export/workplace/master/src/lib/moodlelib.php:6338
      

        1. MDL-70163.jpg
          53 kB
          Anna Carissa Sadia
        2. MDL-70163.php
          0.5 kB
          Paul Holden

            pholden Paul Holden
            pholden Paul Holden
            Carlos Escobedo Carlos Escobedo
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Anna Carissa Sadia Anna Carissa Sadia
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 15 minutes
                2h 15m

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