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

Typo in blocklib leads to block contexts being loaded 1 by 1 from DB rather than being preloaded.

    Details

      Description

      I just found a typo within the lib/blocklib.php that is leading to block contexts for the blocks on a page being fetched 1 by 1 (by get_context_instance) rather than being successfully preloaded by the SQL that is fetching the blocks.

      On a page with 15 blocks fixing the typo results in a 15 less database calls!

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            samhemelryk Sam Hemelryk added a comment -

            Patch created and up on github

            Show
            samhemelryk Sam Hemelryk added a comment - Patch created and up on github
            Hide
            samhemelryk Sam Hemelryk added a comment -

            Ready for integration

            Show
            samhemelryk Sam Hemelryk added a comment - Ready for integration
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Well spotted! Integrated thanks!

            What I don't get is what really was happening with the incorrect condition before, both with non matches and matches.

            Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Well spotted! Integrated thanks! What I don't get is what really was happening with the incorrect condition before, both with non matches and matches. Ciao
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            I mark this as test passed, because I've been performing some debugging when integrating this and can confirm now it returns the correct contexts loaded.

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - I mark this as test passed, because I've been performing some debugging when integrating this and can confirm now it returns the correct contexts loaded.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            An small patch but a big difference for the moodle-ity. Thanks!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - An small patch but a big difference for the moodle-ity. Thanks!

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  1/Aug/11