Moodle
  1. Moodle
  2. MDL-4940

Social Activities Block Disappears When Changing Course Setings

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.3
    • Fix Version/s: 1.6.5, 1.7.2, 1.8
    • Component/s: Blocks
    • Labels:
      None
    • Environment:
      All
    • Database:
      Any
    • Affected Branches:
      MOODLE_15_STABLE
    • Fixed Branches:
      MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE
    • Rank:
      28085

      Description

      If you modify the course setings in a course with the social format, the Social Activities block is deleted. This is because the applicable_formats() method is only defining 'course-view-social' = TRUE. The block is deleted from the page during cleanup after the settings are saved.

        Issue Links

          Activity

          Hide
          Martin Dougiamas added a comment -

          From Justin Filip (jfilip at oktech.ca) Sunday, 19 March 2006, 05:55 AM:

          Here is a patch for this problem:

              • block_social_activities.php 5 Nov 2005 22:05:23 -0000 1.14.2.1

          — block_social_activities.php 18 Mar 2006 21:54:46 -0000

          ***************

              • 7,13 ****

          }

          function applicable_formats()

          { ! return array('course-view-social' => true); }

          function get_content()

          { --- 7,15 ---- }

          function applicable_formats()

          { ! return array('course' => false, ! 'course-*-social' => true, ! 'mod' => false); }

          function get_content() {

          From Marco (davidhoff at tiscali.it) Monday, 20 March 2006, 07:04 PM:

          I've some other info:

          1) I create a new course.

          2) export the DB in xml.

          3) edit the course configuration and don't change anything. Press Save button.

          3) export the DB in xml.

          4) looking for differences in DB

          After pressing the save button in the mdl_block_instance in the DB, disappear the entry with Blockid=20:

          <mdl_block_instance>

          <id>254</id>

          <blockid>20</blockid>

          <pageid>31</pageid>

          <pagetype>course-view</pagetype>

          <position>l</position>

          <weight>2</weight>

          <visible>1</visible>

          <configdata></configdata>

          </mdl_block_instance>

          If I manually insert this instance in the db , the Social Activities block reappear, with all the changes I did in this block before editing the course's configuration...

          From Marco (davidhoff at tiscali.it) Monday, 20 March 2006, 08:03 PM:

          I tryed your fix, in my enviroment it don't work

          From Marco (davidhoff at tiscali.it) Wednesday, 22 March 2006, 06:44 PM:

          There were problems in my Moodle installation.

          The fix in the second post works perfectly.

          From Justin Filip (jfilip at oktech.ca) Wednesday, 22 March 2006, 08:29 PM:

          This problem also exists in HEAD.

          Show
          Martin Dougiamas added a comment - From Justin Filip (jfilip at oktech.ca) Sunday, 19 March 2006, 05:55 AM: Here is a patch for this problem: block_social_activities.php 5 Nov 2005 22:05:23 -0000 1.14.2.1 — block_social_activities.php 18 Mar 2006 21:54:46 -0000 *************** 7,13 **** } function applicable_formats() { ! return array('course-view-social' => true); } function get_content() { --- 7,15 ---- } function applicable_formats() { ! return array('course' => false, ! 'course-*-social' => true, ! 'mod' => false); } function get_content() { From Marco (davidhoff at tiscali.it) Monday, 20 March 2006, 07:04 PM: I've some other info: 1) I create a new course. 2) export the DB in xml. 3) edit the course configuration and don't change anything. Press Save button. 3) export the DB in xml. 4) looking for differences in DB After pressing the save button in the mdl_block_instance in the DB, disappear the entry with Blockid=20: <mdl_block_instance> <id>254</id> <blockid>20</blockid> <pageid>31</pageid> <pagetype>course-view</pagetype> <position>l</position> <weight>2</weight> <visible>1</visible> <configdata></configdata> </mdl_block_instance> If I manually insert this instance in the db , the Social Activities block reappear, with all the changes I did in this block before editing the course's configuration... From Marco (davidhoff at tiscali.it) Monday, 20 March 2006, 08:03 PM: I tryed your fix, in my enviroment it don't work From Marco (davidhoff at tiscali.it) Wednesday, 22 March 2006, 06:44 PM: There were problems in my Moodle installation. The fix in the second post works perfectly. From Justin Filip (jfilip at oktech.ca) Wednesday, 22 March 2006, 08:29 PM: This problem also exists in HEAD.
          Hide
          Justin Filip added a comment -

          This issue, apparently, still exists in Moodle versions 1.5 through to 1.7 (and probably still in 1.8):

          http://moodle.org/mod/forum/discuss.php?d=40151#294592

          Show
          Justin Filip added a comment - This issue, apparently, still exists in Moodle versions 1.5 through to 1.7 (and probably still in 1.8): http://moodle.org/mod/forum/discuss.php?d=40151#294592
          Hide
          Jon Papaioannou added a comment -

          Fixed in all branches from 1.6.x and upwards.

          Justin, I didn't actually use the working fix you suggested because course Pages (i.e. objects of class page_course) should really report their type as "course-view-xxx" and nothing else. It seems to me less error-prone this way, while the possibility of renaming or relocating course/view.php is... quite small.

          Show
          Jon Papaioannou added a comment - Fixed in all branches from 1.6.x and upwards. Justin, I didn't actually use the working fix you suggested because course Pages (i.e. objects of class page_course) should really report their type as "course-view-xxx" and nothing else. It seems to me less error-prone this way, while the possibility of renaming or relocating course/view.php is... quite small.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: