My Moodle: Reset all users back to DEFAULT My Moodle page. How?

My Moodle: Reset all users back to DEFAULT My Moodle page. How?

by Wast Eemail -
Number of replies: 11

Moodle: 2.0.2

I need to reset all users back to the DEFAULT My Moodle page.  How?

I have already made it so that new users cannot customize this page.  However, older users need to be reset back to default.

It would be great if there was an option to ONLY allow use of the DEFAULT My Moodle page setup.

Thanks!

Average of ratings: -
In reply to Wast Eemail

Re: My Moodle: Reset all users back to DEFAULT My Moodle page. How?

by Kyle Egan -

I have the same issue- 'older uses not getting the updates', I would also like a 'Reset to default' button next to the customise this page. Is there a tracker for this, I coulden't see one but i'm pretty new at this.  

I think the issue is here: 'my/index.php'

<!--

if (get_home_page() != HOMEPAGE_MY) {
    if (optional_param('setdefaulthome', false, PARAM_BOOL)) {
        set_user_preference('user_home_page_preference', HOMEPAGE_MY);
    } else if (!empty($CFG->defaulthomepage) && $CFG->defaulthomepage == HOMEPAGE_USER) {
        $PAGE->settingsnav->get('usercurrentsettings')->add(get_string('makethismyhome'), new moodle_url('/my/', array('setdefaulthome'=>true)), navigation_node::TYPE_SETTING);
    }
}

--!>

 

In reply to Kyle Egan

Re: My Moodle: Reset all users back to DEFAULT My Moodle page. How?

by Hubert Chathi -
As far as I know, there is no way to reset a user's page to their My Moodle page, although you can use capabilities to control whether users can make further changes. I am not aware of an existing tracker issue for this, so please create one (and post it here so that I can follow it).
In reply to Wast Eemail

Re: My Moodle: Reset all users back to DEFAULT My Moodle page. How?

by Kyle Egan -

Here we go, I have created a tracker for the issue.

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

Average of ratings:Useful (1)
In reply to Kyle Egan

Re: My Moodle: Reset all users back to DEFAULT My Moodle page. How?

by Guido Hornig -
Picture of Plugin developers

you should add 2.1 and higher to the tracker.

 

In reply to Wast Eemail

Re: My Moodle: Reset all users back to DEFAULT My Moodle page. How?

by Marcus Wynwood -

To reset all users back to the default 'My Moodle' page, you can delete some records in the mdl_my_pages table.
Make sure you leave the records with a NULL userid though.
Something like this:

DELETE FROM mdl_my_pages WHERE userid <> 'NULL';

I've used this on Moodle 2.2 , but use this at your own RISK!
Test it on a non-production server first!

Average of ratings:Useful (3)
In reply to Marcus Wynwood

Re: My Moodle: Reset all users back to DEFAULT My Moodle page. How?

by Seung-Yong Oh -

This method works well even in the moodle 2.3. 

Thanks !

In reply to Marcus Wynwood

Re: My Moodle: Reset all users back to DEFAULT My Moodle page. How?

by Marc Hermon -

mdl_my_pages???  We have just upgraded to 2.2 and I am working out kinks. I need to reset all my pages to default page so was happy when I came across this post. Only problem is I can't find that table in the database????

In reply to Marc Hermon

Re: My Moodle: Reset all users back to DEFAULT My Moodle page. How?

by Marc Hermon -

Hey self! You were being dumb. You were in the wrong moodle database!

In reply to Marcus Wynwood

Re: My Moodle: Reset all users back to DEFAULT My Moodle page. How?

by Pascal Rigaux -

Based on code suggested in MDL-2668, i would say you need to remove corresponding 'my-index'  entries from table 'block_instances'. Here is what i have done:

delete from mdl_block_instances where pagetypepattern = 'my-index' and parentcontextid in (select id from mdl_context where instanceid in (select userid from mdl_my_pages));

delete from mdl_my_pages where userid <> 'NULL';