Hi,
I recently uploaded and enabled the 6.x-1.0-beta1 version of the NodeSymlinks module. When I saved the enable on the module screen I got a white screen of death. My memory limit was fine so I couldn't work out what the problem was. I enabled error reporting as suggested here in the "Enable Error Reporting" section. Refreshing the module page than produced this error:
Parse error: parse error, unexpected '&', expecting T_VARIABLE or '$' in /var/www/http/html/equipes/analyse-synthese/anasyn_proto/website/sites/all/modules/nodesymlinks/nodesymlinks.module on line 641
I am not a coder and I've never written my own module, so I wouldn't presume to be able to debug some one's code, but I decided to take a look at line 641 in nodesymlinks.module. Line 641 read:
foreach ($items as &$item) {
Considering the line in the error report, "unexpected '&', expecting T_VARIABLE or '$'" and my own basic coding knowledge I decided to try deleting the "&" so 641 read:
foreach ($items as $item) {
When I re-uploaded and installed the NodeSymlinks module with this change I no longer got the wsod. I was able to access the nodesymlinks settings page and also add symlinks on the edit pages of my content, so i assume that means my problem is fixed.
I thought I should share this fix since it is a very small problem so I guess easy to miss. I hope this will be helpful. I'm now looking forward to using your module on my site!
Thanks
Comments
Comment #1
wojtha commentedHi,
this is not bug. Iterating array by reference was introduced to PHP in PHP 5.0 five years ago. I guess you are still using PHP 4.
Sorry but I don't (and will not) support PHP 4.