Moodle
  1. Moodle
  2. MDL-14895

Notice: Undefined property: stdClass::$forcedownload in mod/resource/type/file/resource.class.php on line 135

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.9.1
    • Fix Version/s: 1.9.3
    • Component/s: Resource
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      Force download is not initialized and causing:

      Notice: Undefined property: stdClass::$forcedownload in /home/jesuits1/public_html/moodle/mod/resource/type/file/resource.class.php on line 135

      Peace - Anthony

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Anthony Borrow added a comment -

            OK, I know I'm supposed to be writing a paper but I couldn't resist Moodling a little. After all it is still Sunday here and I'm entitled to a little recreation Here's a possible patch ... I still wonder if Moodle HQ should have a chat about coding style via skype.

            http://docs.moodle.org/en/Development:Coding states:

            All variables should be initialised or at least tested for existence using isset() or empty() before they are used.

            For me, that indicates a preference for initializing all variables at the beginning. I think this simple initialization is a good place for comments (if needed about the variable) and it will ultimately keep the code simpler since we will not need to check for the existence of the variable before using it. I'm not sure if this issue was previously discussed amongst the developers. If it has, then I don't want to waste time re-hashing it but as we move toward 2.0 it may be an ideal to strive toward. Any thoughts (am I just being obsessive)? Peace - Anthony

            Show
            Anthony Borrow added a comment - OK, I know I'm supposed to be writing a paper but I couldn't resist Moodling a little. After all it is still Sunday here and I'm entitled to a little recreation Here's a possible patch ... I still wonder if Moodle HQ should have a chat about coding style via skype. http://docs.moodle.org/en/Development:Coding states: All variables should be initialised or at least tested for existence using isset() or empty() before they are used. For me, that indicates a preference for initializing all variables at the beginning. I think this simple initialization is a good place for comments (if needed about the variable) and it will ultimately keep the code simpler since we will not need to check for the existence of the variable before using it. I'm not sure if this issue was previously discussed amongst the developers. If it has, then I don't want to waste time re-hashing it but as we move toward 2.0 it may be an ideal to strive toward. Any thoughts (am I just being obsessive)? Peace - Anthony
            Hide
            Eloy Lafuente (stronk7) added a comment -

            Closing as fixed by MDL-16600. Thanks Anthony.

            Show
            Eloy Lafuente (stronk7) added a comment - Closing as fixed by MDL-16600 . Thanks Anthony.

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: