Im a new developer in Modx, and the previous developer didnt give me any documentation about his project. And now i have to maintain his project.
everytime i open the front end website, i have Fatal error: Call-time pass-by-reference has been removed in /var/www/mysite/core/cache/includes/elements/modsnippet/28.include.cache.php on line 11
here is the code in 28.include.cache.php
line 09....$req = require_once(MODX_BASE_PATH . 'core/components/mysite/model/mysite.class.php');
line 10....if(!isset($modx->mysite)){
line 11.... $modx->mysite = new mysite(&$modx);
line 12....}
Is there someone who experience the same thing like me?
whenever i change the cache,
from $modx->mysite = new mysite(&$modx); to $modx->mysite = new mysite($modx);
i can display it, but then again since its in cache, later on if the cache was restored, and generated a new one, it will rewrite it and gave me error again.
is there away to debug where he wrote the cache?
-
☆ A M B ☆
- 24,524 Posts
Find that line in the actual snippet's code.
Hi sorry to jump on the thread by I'm now getting this error on a lot of sites since a php upgrade on the server. I don't know how many or which sites are effected though - so is there something that can be done to fix them all on the server from WHM or cPanel or Apache rebuild etc?
Or even a linux command line solution from SSH to batch fix everything?
Thanks for any help at all.
This is no longer valid PHP:
$modx->mysite = new mysite(&$modx);
If you put &$modx as an argument in the constructor, it will have the same effect and be legal.
Hi Bob I thought this was all a bit strange having to update code in modx or current plugins when everything should already work with PHP 5.4 - turns out it was down to an SQL injection hack! The sites had been attacked that weren't working but the attack hadn't been visible until the PHP upgrade!
Thanks for the help anyway.