Database Change Is Not Reflected on Web Browser

Database Change Is Not Reflected on Web Browser

by Bayu Prakarsa -
Number of replies: 9

To change a course section name, I changed the "course_sections" table data (the "name" and the "summary" field values), through the Moodle MySQL database, in a local environment (localhost), but the change is not reflected on the web browser (Google Chrome on Windows 8).

I have cleared the web browser's cookies and cache, but Moodle still shows the old course section name. How to make Moodle show the new data on the web browser?

Average of ratings: -
In reply to Bayu Prakarsa

Re: Database Change Is Not Reflected on Web Browser

by Miri Hefetz -

The database change will be shown in the web site after you clear the moodle cache.

The purgecaches.php script is in the administration menu.

site administration -> development->Purge all caches

 

In reply to Miri Hefetz

Re: Database Change Is Not Reflected on Web Browser

by Bayu Prakarsa -

@Miri Hefetz : Do you know how to disable this cache by default? Because I need the viewer to see the new data directly after the change, without having to purge all caches

In reply to Bayu Prakarsa

Re: Database Change Is Not Reflected on Web Browser

by Trevor Furtado -
Picture of Plugin developers

This discussion seems to have one solution for your case, without disabling the cache:

https://moodle.org/mod/forum/discuss.php?d=191773

In reply to Trevor Furtado

Re: Database Change Is Not Reflected on Web Browser

by Bayu Prakarsa -

Thanks. I looked into the "course" folder, but I didn't find the "modinfo" file. I found a "$modinfo" variable in "course/lib.php", then I set the value to "NULL", but the cache still exists (Moodle still shows the old data on the web browser after refreshing the web browser). Did I not set it correctly?

In reply to Bayu Prakarsa

Re: Database Change Is Not Reflected on Web Browser

by Miri Hefetz -

You can call the  function

rebuild_course_cache($courseid, $trye);

 

 

Average of ratings: Useful (1)
In reply to Miri Hefetz

Re: Database Change Is Not Reflected on Web Browser

by Bayu Prakarsa -

The URL of my course web page is http://localhost/moodle/course/view.php?id=2, so I guess the course id is 2.


On the "lib.php", I added the following code at the end:


if($_REQUEST['action']=="rebuild_course_cache")

{

   rebuild_course_cache(2, true);

}


Then to run the rebuild_course_cache($courseid, true) function, I inputted the following URL on the web browser:


http://localhost/moodle/course/lib.php?action=rebuild_course_cache


But it doesn't rebuild the course cache (Moodle still shows the old course section name on the web browser). Did I run the rebuild_course_cache($courseid, true) function wrongly?


In reply to Bayu Prakarsa

Re: Database Change Is Not Reflected on Web Browser

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi Bayu - please don't post the same request in multiple places.

I've already answered your question at:

https://moodle.org/mod/forum/discuss.php?d=191773#p1316170


In reply to Davo Smith

Re: Database Change Is Not Reflected on Web Browser

by Bayu Prakarsa -

Hi Davo,


Sorry... Thanks for the answer.