Moodle
  1. Moodle
  2. MDL-28210

message/lib.php trying to redfine constants already defined

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.3, 2.1, 2.2
    • Fix Version/s: 2.0.4, 2.1.1
    • Component/s: Messages
    • Labels:
      None
    • Environment:
      moodle.org
    • Rank:
      18023

      Description

      From the moodle.org apache error_log after upgrading to 2.1

      PHP Notice:  Constant MESSAGE_SHORTLENGTH already defined in /message/lib.php on line 28
      PHP Notice:  Constant MESSAGE_DISCUSSION_WIDTH already defined in /message/lib.php on line 35
      PHP Notice:  Constant MESSAGE_DISCUSSION_HEIGHT already defined in /message/lib.php on line 36
      PHP Notice:  Constant MESSAGE_SHORTVIEW_LIMIT already defined in /message/lib.php on line 38
      PHP Notice:  Constant MESSAGE_HISTORY_SHORT already defined in /message/lib.php on line 40
      PHP Notice:  Constant MESSAGE_HISTORY_ALL already defined in /message/lib.php on line 41
      PHP Notice:  Constant MESSAGE_VIEW_UNREAD_MESSAGES already defined in /message/lib.php on line 43
      PHP Notice:  Constant MESSAGE_VIEW_RECENT_CONVERSATIONS already defined in /message/lib.php on line 44
      PHP Notice:  Constant MESSAGE_VIEW_RECENT_NOTIFICATIONS already defined in /message/lib.php on line 45
      PHP Notice:  Constant MESSAGE_VIEW_CONTACTS already defined in /message/lib.php on line 46
      PHP Notice:  Constant MESSAGE_VIEW_BLOCKED already defined in /message/lib.php on line 47
      PHP Notice:  Constant MESSAGE_VIEW_COURSE already defined in /message/lib.php on line 48
      PHP Notice:  Constant MESSAGE_VIEW_SEARCH already defined in /message/lib.php on line 49
      PHP Notice:  Constant MESSAGE_SEARCH_MAX_RESULTS already defined in /message/lib.php on line 51
      PHP Notice:  Constant MESSAGE_CONTACTS_PER_PAGE already defined in /message/lib.php on line 53
      PHP Notice:  Constant MESSAGE_MAX_COURSE_NAME_LENGTH already defined in /message/lib.php on line 54
      PHP Notice:  Constant MESSAGE_DEFAULT_LOGGEDIN already defined in /message/lib.php on line 66
      PHP Notice:  Constant MESSAGE_DEFAULT_LOGGEDOFF already defined in /message/lib.php on line 67
      PHP Notice:  Constant MESSAGE_DISALLOWED already defined in /message/lib.php on line 69
      PHP Notice:  Constant MESSAGE_PERMITTED already defined in /message/lib.php on line 70
      PHP Notice:  Constant MESSAGE_FORCED already defined in /message/lib.php on line 71
      PHP Notice:  Constant MESSAGE_PERMITTED_MASK already defined in /message/lib.php on line 73
      PHP Notice:  Constant MESSAGE_DEFAULT_PERMITTED already defined in /message/lib.php on line 78
      

        Activity

        Hide
        Jordan Tomkinson added a comment - - edited

        This was caused by a crawler..

        User-Agent: Mozilla/5.0 (compatible; MJ12bot/v1.3.3; http://www.majestic12.co.uk/bot.php?+
        

        Reproducible when I visit http://moodle.org/message/discussion.php?id=51473

        Show
        Jordan Tomkinson added a comment - - edited This was caused by a crawler.. User-Agent: Mozilla/5.0 (compatible; MJ12bot/v1.3.3; http://www.majestic12.co.uk/bot.php?+ Reproducible when I visit http://moodle.org/message/discussion.php?id=51473
        Hide
        Andrew Davis added a comment -

        Branch based on master. Can go into both master and 2.1

        Show
        Andrew Davis added a comment - Branch based on master. Can go into both master and 2.1
        Hide
        Andrew Davis added a comment -

        Adding to 2.0 stable branch version.

        Show
        Andrew Davis added a comment - Adding to 2.0 stable branch version.
        Hide
        Sam Hemelryk added a comment -

        Looks good to me thanks Andrew - tested also

        Show
        Sam Hemelryk added a comment - Looks good to me thanks Andrew - tested also
        Hide
        Eloy Lafuente (stronk7) added a comment -

        The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

        TIA and ciao

        Show
        Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Hi Andrew,

        I'm rejecting this based on http://docs.moodle.org/dev/Coding_style#Require_.2F_include
        (basically, config.php must be simply "required", using dirname. And the rest be using absolute paths).

        Please amend and I'll happy to integrate this. Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Hi Andrew, I'm rejecting this based on http://docs.moodle.org/dev/Coding_style#Require_.2F_include (basically, config.php must be simply "required", using dirname. And the rest be using absolute paths). Please amend and I'll happy to integrate this. Ciao
        Hide
        Andrew Davis added a comment -

        Oops. Here you go.

        Show
        Andrew Davis added a comment - Oops. Here you go.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Integrated (master, 21 and 20). Added one extra commit to use $CFG->dirroot when requiring / including other libs.

        Show
        Eloy Lafuente (stronk7) added a comment - Integrated (master, 21 and 20). Added one extra commit to use $CFG->dirroot when requiring / including other libs.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Passing. Behavior correct in 3 branches.

        Show
        Eloy Lafuente (stronk7) added a comment - Passing. Behavior correct in 3 branches.
        Hide
        Sam Hemelryk added a comment -

        Congratulations - this fix has just been released in the weeklies.

        Show
        Sam Hemelryk added a comment - Congratulations - this fix has just been released in the weeklies.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: