Moodle
  1. Moodle
  2. MDL-28117

Database activity module: Undefined constant notice

    Details

    • Rank:
      17800

      Description

      When adding a record to the qa.moodle.net database of URLs, I received a

      Notice: Use of undefined constant FILE_EXTERNAL - assumed 'FILE_EXTERNAL' in /html/mod/data/field/url/field.class.php on line 33

      FILE_EXTERNAL is defined in repository/lib.php

        Issue Links

          Activity

          Hide
          Anthony Borrow added a comment -

          Interestingly enough, I cannot reproduce this on my local 2.1 install. Peace - Anthony

          Show
          Anthony Borrow added a comment - Interestingly enough, I cannot reproduce this on my local 2.1 install. Peace - Anthony
          Hide
          Charles Fulton added a comment -

          I can't either, and I took the extra step of configuring a repository first, thinking that might be related.

          Show
          Charles Fulton added a comment - I can't either, and I took the extra step of configuring a repository first, thinking that might be related.
          Hide
          Michael de Raadt added a comment -

          This is the second issue that seems to come up on qa.moodle.net, but not elsewhere.

          I'm recruiting Jordan to help us sort out why these bugs are happening on QA and not replicable elsewhere.

          Show
          Michael de Raadt added a comment - This is the second issue that seems to come up on qa.moodle.net, but not elsewhere. I'm recruiting Jordan to help us sort out why these bugs are happening on QA and not replicable elsewhere.
          Hide
          Anthony Borrow added a comment -

          Michael - I am wondering if this may have something to do with some of Sam's optimizations with navigation. It seems to be pretty specific. I do not see the error if I login as admin and add a record; however, if I login as teacher then I do get it for the first entry I add. After that, things are fine. I'll work on replicating it on a clean install and see what we can track down. Peace - Anthony

          Show
          Anthony Borrow added a comment - Michael - I am wondering if this may have something to do with some of Sam's optimizations with navigation. It seems to be pretty specific. I do not see the error if I login as admin and add a record; however, if I login as teacher then I do get it for the first entry I add. After that, things are fine. I'll work on replicating it on a clean install and see what we can track down. Peace - Anthony
          Hide
          Jordan Tomkinson added a comment -

          This is not specific to qa.moodle.net and is only visible when logged in as teacher - admin user does not display error
          FILE_EXTERNAL is defined in /repository/lib.php - I would check to see if this is not being included due to moodle user permissions.

          Show
          Jordan Tomkinson added a comment - This is not specific to qa.moodle.net and is only visible when logged in as teacher - admin user does not display error FILE_EXTERNAL is defined in /repository/lib.php - I would check to see if this is not being included due to moodle user permissions.
          Hide
          Petr Škoda added a comment -

          the FILE_INTERNAL and FILE_EXTERNAL is placed in incorrect file, the core should not know much about repositories, they are used only from the form element internals, that means requiring these in constructors of these elements does not make any sense, I am going to review the code and move them to proper place - that is filelib.php (forms are already including it).

          Show
          Petr Škoda added a comment - the FILE_INTERNAL and FILE_EXTERNAL is placed in incorrect file, the core should not know much about repositories, they are used only from the form element internals, that means requiring these in constructors of these elements does not make any sense, I am going to review the code and move them to proper place - that is filelib.php (forms are already including it).
          Hide
          Petr Škoda added a comment -

          ohlala, I just found the file_picker class in the outputcomponents, I was wrong in my previous comment. This looks like a big hack, I would expect url_picker there, anyway sending patch.

          Show
          Petr Škoda added a comment - ohlala, I just found the file_picker class in the outputcomponents, I was wrong in my previous comment. This looks like a big hack, I would expect url_picker there, anyway sending patch.
          Hide
          Sam Hemelryk added a comment -

          Hi Petr,
          Is this change needed in MOODLE_21_STABLE as well?

          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - Hi Petr, Is this change needed in MOODLE_21_STABLE as well? Cheers Sam
          Hide
          Petr Škoda added a comment -

          I guess yes

          Show
          Petr Škoda added a comment - I guess yes
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated, thanks! (20, 21 and master)

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated, thanks! (20, 21 and master)
          Hide
          Rajesh Taneja added a comment -

          Works Great
          Thanks for providing the patch Petr.

          Show
          Rajesh Taneja added a comment - Works Great Thanks for providing the patch Petr.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Moodle's git/cvs repositories have been updated with this piece of art! Thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Moodle's git/cvs repositories have been updated with this piece of art! Thanks!

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: