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

Export calendar by userid & problem getting the calendar URL for subscription

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.3, 2.1.2, 2.2
    • Fix Version/s: 2.0.6, 2.1.3
    • Component/s: Calendar
    • Labels:
    • Environment:
      Mac + Safari + MySQL
    • Testing Instructions:
      Hide

      before applying patch, do the following:
      if you are testing it on 2.1 or 2.2, do the following:

      • on calendar/export.php line 97, add: $now = usergetdate(time());
      • on calendar/lib.php line 1809, change:
        $context = get_context_instance(CONTEXT_USER);
        to
        $context = get_context_instance(CONTEXT_USER, $data->userid);

      The above hacks are existing bug that occurs on 2.1 and 2.2. Without the hack, you won't be able to add event or perform the testing.

      1. add new events for the calendar.
      2. view the calendar by month
      3. select 'export calendar' button
      4. copy get calendar url link.
      5. apply the patch
      if you are on 2.1 or 2.2, make sure you remove the above hacks before applying the patch.
      6. go to view calendar by month
      7. select 'export calendar' button

      make sure the export and get calendar url works. Also make sure old calendar url works after applying the patch.

      Show
      before applying patch, do the following: if you are testing it on 2.1 or 2.2, do the following: on calendar/export.php line 97, add: $now = usergetdate(time()); on calendar/lib.php line 1809, change: $context = get_context_instance(CONTEXT_USER); to $context = get_context_instance(CONTEXT_USER, $data->userid); The above hacks are existing bug that occurs on 2.1 and 2.2. Without the hack, you won't be able to add event or perform the testing. 1. add new events for the calendar. 2. view the calendar by month 3. select 'export calendar' button 4. copy get calendar url link. 5. apply the patch if you are on 2.1 or 2.2, make sure you remove the above hacks before applying the patch. 6. go to view calendar by month 7. select 'export calendar' button make sure the export and get calendar url works. Also make sure old calendar url works after applying the patch.
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      This is one follow-up of MDL-27192.

      1) Right now the calendar/export_execute.php script uses to work by username + token, completely ignoring any possible mnet stuff, potentially leading to privacy problems or, at least, wrong behavior because username is not a valid unique identifier at all.

      Solution: Make it work with "userid" parameter instead but keep the old (username based) way working for BC. Marking it as deprecated for, say, 2.3

      2) The export interface doesn't seem to work ok here, so switching from week to 60 days back and forth doesn't cause the URL for subscriptions to be refreshed at all (always "weekly" is shown).

      Ciao

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    28/Nov/11