Skip to content

Commit

Permalink
Merge branch 'MDL-48544-master' of git://github.com/andrewnicols/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Feb 9, 2015
2 parents 8edac41 + 4b410a6 commit c874c3c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions blocks/tests/behat/hide_blocks.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@core @core_block
Feature: Block visibility
In order to configure blocks visibility
As a teacher
I need to show and hide blocks on a page

Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
And I am on homepage
And I follow "Course 1"
And I follow "Turn editing on"

@javascript
Scenario: Hiding all blocks on the page should remove the column they're in
Given I open the "Search forums" blocks action menu
And I click on "Hide Search forums block" "link" in the "Search forums" "block"
And I open the "Latest news" blocks action menu
And I click on "Hide Latest news block" "link" in the "Latest news" "block"
And I open the "Upcoming events" blocks action menu
And I click on "Hide Upcoming events block" "link" in the "Upcoming events" "block"
And I open the "Recent activity" blocks action menu
When I click on "Hide Recent activity block" "link" in the "Recent activity" "block"
Then ".empty-region-side-post" "css_element" should not exist in the "body" "css_element"
And I follow "Turn editing off"
And ".empty-region-side-post" "css_element" should exist in the "body" "css_element"
2 changes: 1 addition & 1 deletion lib/blocklib.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ public function region_completely_docked($region, $output) {
return false;
}
foreach ($this->visibleblockcontent[$region] as $instance) {
if (!empty($instance->content) && !get_user_preferences('docked_block_instance_'.$instance->blockinstanceid, 0)) {
if (!get_user_preferences('docked_block_instance_'.$instance->blockinstanceid, 0)) {
return false;
}
}
Expand Down

0 comments on commit c874c3c

Please sign in to comment.