|
[
Permalink
| « Hide
]
Dan Poltawski added a comment - 04/Jan/08 08:02 AM
Have just reproduced this on 1.9.. Adding some watchers and raising priority.
I agree - it should return a cloned obj. All the other caching schemes I'm aware of (memcached, eaccelerator, apc, turck) will return a different object, not a reference.
It is fairly constrained...
and probably easy to fix Reproduced on 1.9 also.
Modified the set_rcache method so that it saves a clone of the record object. This solves this issue.
Reopening. This patch is wrong on 2 counts
Patched to
Under PHP4 I'm getting the following error:
Parse error: parse error, unexpected T_VARIABLE in /var/www/cvs/19/moodle/lib/dmllib.php on line 2586 This happens after a fresh install of MOODLE_19_STABLE Causes syntax error in PHP4 causing new installation to fail
Thanks for spotting this - eagle eyes, finding the right bug to comment this. Just fixed it so if you update in the next hour or so you should get the fix.
Else, just search for clone $bla and replace it with clone($bla) - we need the parenthesis for it to work correctly in PHP4. I'm off home for the day, so it'd be great to hear feedback on the fix I just committed to cvs. I just updated/tested and it's working fine for me now.
Thanks. Thanks for all of the great work on this. Checked out the code and it looks like Martin's changes have not been merged to HEAD or to MOODLE_18_STABLE. MOODLE_18_STABLE is still using fullclone and HEAD is using clone without the open/close parenthesis.
Good spotting. The commit to HEAD had errored out and I didn't realise. Fixed in HEAD and 18_STABLE now.
Thanks Martin for your patch, and sorry about my botch-up
Looks like we are not done. Get the following error:
Fatal error: __clone method called on non-object in path/to/lib/dmllib.php on line 2327 Looks like we are caching boolean false as well (least in this case). Need to check to see if it is an object before cloning. Attaching a diff with a proposed solution.
Mark, Dan Poltawski already spotted and fixed it as
Closing again since the reason why it was opened is now in
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||