Social activities block disappears after opening configuration page

Social activities block disappears after opening configuration page

by Marco Bro -
Number of replies: 16
Hi,
using the latest stable release, 1.5.3+(2005060230), I add a course with the social format and add the social activities block on the page. The problem is that the social activities block disappears everytime after I open the configuration page of the course.
Looking at the "General Problems" forum I'm not the only that encounter this annoying bug.
This is my configuration:
Moodle 1.53+ (2005060230)
Operating System: Windows Server 2003 Enterprise
Webserver: IIS 6
Php version: 5.1.1
MySQL version: 5.0.15
block_social_activities.php v 1.14.2.1 (version 2004041800)
And another user report the same error with this:
Moodle 1.53+ (2005060230)
Operating System: SunOS 5.9
Webserver: Apache/2.0.52 (Unix) PHP/4.3.10 mod_ssl/2.0.52 OpenSSL/0.9.7d
Php version: 4.3.10
MySQL version: 4.0.22
So probably it's a Moodle bug..
Marco
Average of ratings: -
In reply to Marco Bro

Re: Social activities block disappears after opening configuration page

by Marco Bro -
 
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...
 
@D!
In reply to Marco Bro

Re: Social activities block disappears after opening configuration page

by Marco Bro -
Really nobody has this problem?
Please give me an advice mixed
Marco
In reply to Marco Bro

Re: Social activities block disappears after opening configuration page

by Justin Filip -
I submitted a bug report and a patch for this problem, but if you just want to fix it on your site, you need to edit the file /blocks/social_activities/block_social_activities.php and change the following from:

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

to:

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

The problem is when the course settings get changed, the page type isn't 'course-view-social' anymore and the block is deleted from the page because it is not applicable in the current view.  The above should make sure that the block only stays on the index page of the course and it will stay there after you change the course settings.
In reply to Justin Filip

Re: Social activities block disappears after opening configuration page

by Marco Bro -
Hi Justin,
I've tried your patch but it don't fix the problem sad
I'm following your bug report
 
Marco
In reply to Marco Bro

Re: Social activities block disappears after opening configuration page

by Justin Filip -
Really?  That's very odd.  It works for me and I'm not the only one who this works for.  It's how I've gotten around the same problem before in a custom block I was working on.

And this specific also works for me on a 1.5.3+ setup.
In reply to Justin Filip

Re: Social activities block disappears after opening configuration page

by Marco Bro -
 I'm really in trouble:
 
I mantain 2 different moodle installation. The first is quite simple, "standard" configuration, used by 10 or 15 students. There your fix works.
 
The main moodle installation is for my university intranet. I modify some (really not much) php files to adapt it to our needs, but I didn't edit block_social_activities.php at all.
In this enviroment (the most important for me mixed) your fix don't work: after editing the course property, the social_activities block disappear...
Can you give me some advice, where I could look for the error?
Thanks
Marco
In reply to Marco Bro

Re: Social activities block disappears after opening configuration page

by Justin Filip -
You could try, on the Intranet version, only modifying the applicable_formats() method so that it looks like this:


    function applicable_formats() {
        return array('course' => true);
    }

The only downside to this is that the block will be in the list of available blocks for ANY course-related page, be it another course format, a course mod page, etc.

But so long as the people with system access who could place blocks on pages know not to use it anywhere else you should be fine.

Also, if the above doesn't work, then you've made some really odd changes somewhere and I'd suggest turning Debugging on from the Site Variables page off the Admin menu.  Perhaps it will give you some output that indicates where the problem is.
In reply to Justin Filip

Re: Social activities block disappears after opening configuration page

by Marco Bro -
I really don't know where and why, but there were some problems in the DB.
I restart with a new db and the Social Activities block now works.
I've only to migrate data to the new db thoughtful
Thank you really much for your help Justin!
Marco
In reply to Marco Bro

Re: Social activities block disappears after opening configuration page

by Justin Filip -
Glad to hear it!

The problem with this block exists in 1.6 also so hopefully the fix will be applied... somewhere. smile
In reply to Justin Filip

Re: Social activities block disappears after opening configuration page

by Marco Bro -
Really it's still in 1.6?!?
It's very strange, for me it's a great bug thoughtful
In reply to Marco Bro

Re: Social activities block disappears after opening configuration page

by Jason Hollowell -
Picture of Particularly helpful Moodlers
Hello,

This seems like an old thread and may be dead but I have this same exact problem in 1.7 Did this not get fixed?? or is there some other cause besides bad code?

And, if I have my course set to "Social Format" which I do, setting an enrollment key does nothing. I can create a new account using e-mail authentication and go right into the course without having to enter the key!!??

This is the first time I've ever used the "Social Format" course layout setting so I don't know if it's a problem with that setting, with 1.7, or with my setup?

Jason
In reply to Jason Hollowell

Re: Social activities block disappears after opening configuration page

by Justin Filip -
I have a patch (that I posted in the forums about) which fixes this problem but has never been applied. It's in the bug tracker.

http://tracker.moodle.org/browse/MDL-4940

I guess you can go and vote on the issue there but I don't know if it makes a difference. I mean, I already fixed it. Someone just needs to apply my patch into the main CVS.
In reply to Justin Filip

Re: Social activities block disappears after opening configuration page

by Jason Hollowell -
Picture of Particularly helpful Moodlers
Justin,

Thanks, I applied the change and everything is great now. Kind of surprised it hasn't been updated into recent versions.

Jason
In reply to Jason Hollowell

Re: Social activities block disappears after opening configuration page

by Justin Filip -
Jason,

I have good news.
In reply to Justin Filip

Re: Social activities block disappears after opening configuration page

by John Papaioannou -
Fixed as promised! smile

Only in 1.6.x and upwards though. If someone is still using 1.5.x, it is a good idea to upgrade anyway.

Jon
In reply to John Papaioannou

Re: Social activities block disappears after opening configuration page

by Giovanni Tomasello -
Good Morning, I still have this problem!

I'm using moodle 1.9.5+ (base installation, no plugin) in this environment:

Windows Server 2003
IIS
SQL Server 2005


In a course in SCORM format, when i open setting page, the Social Activities block disappear.
Can we help me?

Thank's