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

block_lp / competencies api breaks badly when not user is logged in

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1
    • Component/s: Competencies
    • Labels:
    • Testing Instructions:
      Hide
      Setup
      1. Login as an admin/site manager.
      2. Create a user s1.
      3. Navigate to s1's profile and click Learning plans.
      4. Create a new learning plan for s1. Name it s1's LP.
      5. Navigate to the Dashboard and click Customise this page
      6. Click Site home on the Navigation block.
      7. Under Add a block, select Learning plans.
        • Confirm that the Learning plans block is added on the front page.
      Logging out
      1. Log out.
        • Confirm that there are no errors and the front page is displayed fine.
        • Confirm that the Learning plans block is not being displayed.
      Logging in as guest
      1. Log in as guest.
        • Confirm that there are no errors and the front page is displayed fine.
        • Confirm that the Learning plans block is not being displayed.
      Logging in as a user with a learning plan.
      1. Login as s1.
      2. Click Site home.
        • Confirm that s1's learning plan s1's LP is properly listed in the Learning plans block.
      Show
      Setup Login as an admin/site manager. Create a user s1. Navigate to s1's profile and click Learning plans . Create a new learning plan for s1. Name it s1's LP . Navigate to the Dashboard and click Customise this page Click Site home on the Navigation block. Under Add a block , select Learning plans . Confirm that the Learning plans block is added on the front page. Logging out Log out. Confirm that there are no errors and the front page is displayed fine. Confirm that the Learning plans block is not being displayed. Logging in as guest Log in as guest. Confirm that there are no errors and the front page is displayed fine. Confirm that the Learning plans block is not being displayed. Logging in as a user with a learning plan. Login as s1. Click Site home . Confirm that s1's learning plan s1's LP is properly listed in the Learning plans block.
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull Master Branch:
      MDL-53996-master

      Description

      I've not been able to find this reported, although it seems to be really easy to reproduce:

      1) Create a framework.
      2) Add block_lp to frontpage
      3) log out.
      4) BOOM

      Invalid user
      Debug info: SELECT id FROM {user} WHERE id = ? AND deleted = ?
      [array (
      0 => 0,
      1 => 0,
      )]
      Error code: invaliduser
      Stack trace:
      line 1502 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
      line 1478 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
      line 6506 of /lib/accesslib.php: call to moodle_database->get_record()
      line 2318 of /competency/classes/api.php: call to context_user::instance()
      line 71 of /blocks/lp/classes/output/summary.php: call to core_competency\api::list_user_plans()
      line 69 of /blocks/lp/block_lp.php: call to block_lp\output\summary->__construct()
      line 288 of /blocks/moodleblock.class.php: call to block_lp->get_content()
      line 230 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
      line 976 of /lib/blocklib.php: call to block_base->get_content_for_output()
      line 1028 of /lib/blocklib.php: call to block_manager->create_block_contents()
      line 476 of /lib/outputrenderers.php: call to block_manager->ensure_content_created()
      line 39 of /theme/bootstrapbase/renderers/core_renderer.php: call to core_renderer->standard_head_html()
      line 52 of /theme/clean/layout/columns3.php: call to theme_bootstrapbase_core_renderer->standard_head_html()
      line 1028 of /lib/outputrenderers.php: call to include()
      line 958 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
      line 112 of /index.php: call to core_renderer->header()
      

      Ciao

        Attachments

          Activity

            People

            Assignee:
            jpataleta Jun Pataleta
            Reporter:
            stronk7 Eloy Lafuente (stronk7)
            Peer reviewer:
            Ryan Wyllie
            Integrator:
            David Monllaó
            Tester:
            Simey Lameze
            Participants:
            Component watchers:
            Jean-Philippe Gaudreau, Steve Massicotte, Serge Gauthier, Issam Taboubi, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              23/May/16