Moodle
  1. Moodle
  2. MDL-25478

Odd bug adding blocks to a page for a new resource/activity

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.2
    • Component/s: Course
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      6656

      Description

      On a "course - add a resourse" or "course - add an activity" pages "Add a block" functionality didn't work.

      To reproduce:
      From the course page, turn editing on
      Select a new resource or activity (any type)
      While on the resource adding page (i.e. the form), choose "Add..." from the Blocks drop-down
      It'll bork spectacularly with this:
      Warning: end() expects parameter 1 to be array, null given in /Users/myles/git/une/php/m2/lib/blocklib.php on line 642
      A required parameter (section) was missing
      Stack trace:
      • line 421 of /lib/setuplib.php: moodle_exception thrown
      • line 450 of /lib/moodlelib.php: call to print_error()
      • line 48 of /course/modedit.php: call to required_param()
      Coding error detected, it must be fixed by a programmer: Trying to reference an unknown block region
      Stack trace:
      • line 813 of /lib/blocklib.php: coding_exception thrown
      • line 613 of /lib/blocklib.php: call to block_manager->check_region_is_known()
      • line 662 of /lib/blocklib.php: call to block_manager->add_block()
      • line 1051 of /lib/blocklib.php: call to block_manager->add_block_at_end_of_default_region()
      • line 1026 of /lib/blocklib.php: call to block_manager->process_url_add()
      • line 1178 of /lib/pagelib.php: call to block_manager->process_url_actions()
      • line 702 of /lib/pagelib.php: call to moodle_page->starting_output()
      • line 580 of /lib/outputrenderers.php: call to moodle_page->set_state()
      • line 2086 of /lib/outputrenderers.php: call to core_renderer->header()
      • line ? of unknownfile: call to core_renderer->fatal_error()
      • line 1200 of /lib/setuplib.php: call to call_user_func_array()
      • line 320 of /lib/setuplib.php: call to bootstrap_renderer->__call()
      • line 320 of /lib/setuplib.php: call to bootstrap_renderer->fatal_error()
      • line ? of unknownfile: call to default_exception_handler()

        Activity

        Hide
        Dan Poltawski added a comment -

        Thanks, i've created PULL-65 for this to be merged upstream

        Show
        Dan Poltawski added a comment - Thanks, i've created PULL-65 for this to be merged upstream
        Hide
        Petr Škoda added a comment -

        Oh, the "Add block" should not be displayed on pages that do not have block regions, I suppose all forms pages should have the blocks disabled.

        Anyway the set URL fixes should be done too.

        thanks!

        Show
        Petr Škoda added a comment - Oh, the "Add block" should not be displayed on pages that do not have block regions, I suppose all forms pages should have the blocks disabled. Anyway the set URL fixes should be done too. thanks!
        Hide
        Dan Poltawski added a comment -

        I guess thats done with some sort of configuration pagetype? Does one exist now to do this?

        Show
        Dan Poltawski added a comment - I guess thats done with some sort of configuration pagetype? Does one exist now to do this?

          People

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

            Dates

            • Created:
              Updated:
              Resolved: