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

Manage subscription throw error, if length of event name is more than 255

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.1
    • Fix Version/s: 2.5
    • Component/s: Calendar
    • Labels:
    • Testing Instructions:
      Hide

      Test 1

      1. Prerequisite: Moodle site without this patch
      2. Navigate to calendar (Course > Upcoming events block > Go to calendar...")
      3. Add course event, user event and site event.
      4. Apply this patch and upgrade site
      5. Check events which were created above and make sure there is no change.
      6. Check database and make sure name field in mdl_event table is of type text.

      Test 2

      1. Log in as any user
      2. Navigate to the calendar (Course > Upcoming events block > Go to calendar..."
      3. Click Manage subscriptions
      4. Add a calendar name and the URL (https://www.google.com/calendar/ical/gsummerofcode%40gmail.com/public/basic.ics)
      5. Make sure you don't see any error.

      Test 3

      1. Install new moodle site with this patch
      2. Check database and make sure name field in mdl_event table is of type text.
      Show
      Test 1 Prerequisite: Moodle site without this patch Navigate to calendar (Course > Upcoming events block > Go to calendar...") Add course event, user event and site event. Apply this patch and upgrade site Check events which were created above and make sure there is no change. Check database and make sure name field in mdl_event table is of type text. Test 2 Log in as any user Navigate to the calendar (Course > Upcoming events block > Go to calendar..." Click Manage subscriptions Add a calendar name and the URL ( https://www.google.com/calendar/ical/gsummerofcode%40gmail.com/public/basic.ics ) Make sure you don't see any error. Test 3 Install new moodle site with this patch Check database and make sure name field in mdl_event table is of type text.
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull Master Branch:
      wip-mdl-38344

      Description

      I was testing the calendar subscription system using the following URL.

      https://www.google.com/calendar/ical/gsummerofcode%40gmail.com/public/basic.ics

      When the subscription form was submitted the following error was shown.

      Error writing to database
       
      More information about this error
       
      Debug info: 
      Error code: dmlwriteexception
      Stack trace:
      line 476 of \lib\setuplib.php: moodle_exception thrown
      line 83 of \calendar\managesubscriptions.php: call to print_error()
      

      Replication steps:

      1. Log in as any user
      2. Navigate to the calendar (Course > Upcoming events block > Go to calendar..."
      3. Click Manage subscriptions
      4. Add a calendar name and the URL above

      It may be that the @ in the URL is being filtered at some point, which is preventing the fetching of calendar events. It looks like the subscription is being added but no events are being added for it.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    14/May/13