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

Fix missing variable bug with link dnd code

    XMLWordPrintable

Details

    • MOODLE_38_STABLE
    • MOODLE_37_STABLE, MOODLE_38_STABLE
    • Hide

      1. Go to 'Development' -> 'Experimental settings' and enable 'dndallowtextandlinks'
      2. Go to a course and turn editing on
      3. Open another browser window and go to youtube.com
      4. Try to drag a link from the youtube window into the course (just drag a link into the course until you see 'add link here' drop area
      5. Continue, setting a name and clicking 'Upload'
      6. Review your server's error logs (for apache, just check /var/log/apache2/error.log)
      7. Confirm there is NOT the notice

      PHP Notice: Undefined property: stdClass::$coursemodule 

      Show
      1. Go to 'Development' -> 'Experimental settings' and enable 'dndallowtextandlinks' 2. Go to a course and turn editing on 3. Open another browser window and go to youtube.com 4. Try to drag a link from the youtube window into the course (just drag a link into the course until you see 'add link here' drop area 5. Continue, setting a name and clicking 'Upload' 6. Review your server's error logs (for apache, just check /var/log/apache2/error.log) 7. Confirm there is NOT the notice PHP Notice: Undefined property: stdClass::$coursemodule

    Description

      When using the experimental feature 'drag and drop of links and text', and specifically when dragging a link from one browser window into Moodle, a notice will be seen the the web server logs regarding a missing variable. This isn't seen since the call to create the resource is an async one, however, for the MoodleNet 3.8 plugin to work properly (i.e. NOT generate a notice on screen), we need to patch this.

      The fix for this on the master branch is being included as part of the master MoodleNet plugin on MDL-67883, so this is only needed for 3.8.

      To replicate:
      1. Go to 'Development' -> 'Experimental settings' and enable 'dndallowtextandlinks'
      2. Go to a course and turn editing on
      3. Open another browser window and go to youtube.com
      4. Try to drag a link from the youtube window into the course (just drag a link into the course until you see 'add link here' drop area
      5. Continue, setting a name and clicking 'Upload'
      6. Review your server's error logs (for apache, just check /var/log/apache2/error.log)
      7. See the notice:

      PHP Notice:  Undefined property: stdClass::$coursemodule 

       

      Attachments

        Issue Links

          Activity

            People

              jaked Jake Dallimore
              jaked Jake Dallimore
              Mihail Geshoski Mihail Geshoski
              Adrian Greeve Adrian Greeve
              Janelle Barcega Janelle Barcega
              Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                13/Jul/20

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 1 minute
                  1h 1m