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

Emailing attachment has reliance on $CFG->localrequestdir

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.10
    • 3.10.2
    • Email
    • MOODLE_310_STABLE
    • MOODLE_310_STABLE
    • MDL-70163-311
    • 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  

    Description

      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
      

      Attachments

        Issue Links

          Activity

            People

              pholden Paul Holden
              pholden Paul Holden
              Carlos Escobedo Carlos Escobedo
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Anna Carissa Sadia Anna Carissa Sadia
              David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                8/Mar/21

                Time Tracking

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