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

Database activity module: Undefined constant notice

    Details

      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

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              aborrow Anthony Borrow added a comment -

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

              Show
              aborrow Anthony Borrow added a comment - Interestingly enough, I cannot reproduce this on my local 2.1 install. Peace - Anthony
              Hide
              cfulton 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
              cfulton 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
              salvetore 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
              salvetore 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
              aborrow 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
              aborrow 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
              jtomkinson 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
              jtomkinson 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
              skodak Petr Skoda 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
              skodak Petr Skoda 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
              skodak Petr Skoda 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
              skodak Petr Skoda 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
              samhemelryk Sam Hemelryk added a comment -

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

              Cheers
              Sam

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

              I guess yes

              Show
              skodak Petr Skoda added a comment - I guess yes
              Hide
              stronk7 Eloy Lafuente (stronk7) added a comment -

              Integrated, thanks! (20, 21 and master)

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

              Works Great
              Thanks for providing the patch Petr.

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

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

              Show
              stronk7 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:
                    Fix Release Date:
                    1/Aug/11