Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 1.8, 1.9
-
Component/s: Database activity module, Libraries
-
Labels:None
-
Environment:PHP5
-
Affected Branches:MOODLE_18_STABLE, MOODLE_19_STABLE
-
Fixed Branches:MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE
Description
Moodle config settings:
cachetype: internal
rcache: true
The test (I added this block to the top of index.php):
// Get course, print name, change name
$course = get_record('course', 'id', SITEID);
notify($course->fullname); // Prints: TESTING SITE
$course->fullname = 'newname';
// Get course again, print name
$course = get_record('course', 'id', SITEID);
notify($course->fullname); // Prints: newname
die;
From the above, the first time we get the course, we modify it, which in turn modifies the object in the cache. The cache should return a clone of the object stored in the cache to prevent this from happening.
This doesn't seem to be a problem with the other caching types, but I wasn't able to test eaccelerator.