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

workshop incorrectly expects that admin is logged in during upgrade

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1.5, 2.2, 2.3
    • Fix Version/s: 2.1.6, 2.2.3
    • Component/s: Workshop
    • Labels:
    • Testing Instructions:
      Hide

      Testing difficulty: HARD (requires control over installed Moodle code version)

      1. Install a fresh new Moodle using the code that does not contain MDL-25660 fix yet. Hint: you can use 2.2.0 or 2.1.0 as the fix was added later on those branches
      2. Create a new course and a new workshop in it. Specify some deadlines in the "Access control" section.
      3. TEST: Make sure that no calendar events were created in the calendar (because MDL-25660 is not fixed yet in your install)
      4. Log out (this is important, we need to run the upgrade as anonymous user, not as admins)
      5. Change the code of the Moodle to the version from integration.git for the given branch (so, if your test install was based on 2.2.0, update the code to integration/MOODLE_22_STABLE etc)
      6. Visit the /admin page to execute to upgrade
      7. TEST: Make sure that the upgrade executes without the reported error
      8. TEST: Visit the course and make sure that events were created in the calendar

      (I already tested this at PostgreSQL 9.0 on the 2.2.0 -> 2.2.2+ upgrade path)

      Show
      Testing difficulty: HARD (requires control over installed Moodle code version) 1. Install a fresh new Moodle using the code that does not contain MDL-25660 fix yet. Hint: you can use 2.2.0 or 2.1.0 as the fix was added later on those branches 2. Create a new course and a new workshop in it. Specify some deadlines in the "Access control" section. 3. TEST: Make sure that no calendar events were created in the calendar (because MDL-25660 is not fixed yet in your install) 4. Log out (this is important, we need to run the upgrade as anonymous user, not as admins) 5. Change the code of the Moodle to the version from integration.git for the given branch (so, if your test install was based on 2.2.0, update the code to integration/MOODLE_22_STABLE etc) 6. Visit the /admin page to execute to upgrade 7. TEST: Make sure that the upgrade executes without the reported error 8. TEST: Visit the course and make sure that events were created in the calendar (I already tested this at PostgreSQL 9.0 on the 2.2.0 -> 2.2.2+ upgrade path)
    • Workaround:
      • use CLI upgrade script
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-32630-workshop-calendar

      Description

      see http://moodle.org/mod/forum/discuss.php?d=201260

      Sorry, but you do not currently have permissions to update calendar event
      More information about this error
      Stack trace:

      • line 435 of /lib/setuplib.php: moodle_exception thrown
      • line 1912 of /calendar/lib.php: call to print_error()
      • line 2306 of /calendar/lib.php: call to calendar_event->update()
      • line 1445 of /mod/workshop/lib.php: call to calendar_event::create()
      • line 356 of /mod/workshop/db/upgrade.php: call to workshop_calendar_update()
      • line 540 of /lib/upgradelib.php: call to xmldb_workshop_upgrade()
      • line 271 of /lib/upgradelib.php: call to upgrade_plugins_modules()
      • line 1437 of /lib/upgradelib.php: call to upgrade_plugins()
      • line 269 of /admin/index.php: call to upgrade_noncore()

      Solution:
      1/ modify events api to include $checkcapability=true parameter the same way as update() method
      2/ use this new parameter in workshop_calendar_update()

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

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