I've just downloaded CivicSpace RC081 from SVN and run through the install. My
environment is:
Mac OSX 10.3
Apache2
MySQL 4.1
PHP 5
The install seemed to go well - but I got a few warnings from
array_merge function and then a warning during configure - "Invalid
argument supplied for foreach() in /Users/..."
At this point, I have an admin user (user 1) that I can login with - but when I go to http://localhost/dgg/cs/?q=admin, all I get is the watchdog table display - there are no admin menu links.
On all pages, I get the following array_merge function error across the top:
warning: array_merge() [function.array-merge]: Argument #2 is not an
array in /Users/dgg/htdocs/civicspace081rc/themes/engines/phptemplate/phptemplate.engine
on line 42.
| Comment | File | Size | Author |
|---|---|---|---|
| Cspace_081_PHP5.gif | 94.82 KB | dggreenberg |
Comments
Comment #1
cypherpunk commentedPHP 5.04
Apache/2.0.53 (mpm/prefork)
MySQL 4.023
Ubuntu Hoary (amd64)
I also found these array_merge warnings in the CivicSpace configuration wizard using PHP5.
warning: array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #2 is not an array in /home/charles/civicspace/modules/configure/wizard.inc on line 59.warning: array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #2 is not an array in /home/charles/civicspace/themes/engines/phptemplate/phptemplate.engine on line 42.Comment #2
cypherpunk commentedPHP5 changed the calling syntax for array_merge -- array_merge() will only accept arguments of type (array).
A solution to this particular bug is to manually cast all array_merge() arguments as type(array)...
Change:
$vars = array_merge($vars, _phptemplate_variables($hook, $vars));To:
$vars = array_merge($vars, (array)_phptemplate_variables($hook, $vars));Manually changing every array_merge call might not be the best solution - as it is ultimately the task of the calling theme to ensure that variables of the correct type are passed back to the template engine, imho.
Comment #3
Zack Rosen commentedComment #4
factoryjoe commentedThis is not a CivicSpace theme issue but a PHPTemplate problem.
Comment #5
stevryn commentedI get these array_merge errors when using any of the Civicspace themes, but not with any other PHPTemplate themes. So is the fix to this to change the PHPTemplate engine, and how or what does one do to it to fix it?
Comment #6
stevryn commentedFix in #2 worked for the array errors, thanks!
Comment #7
venkat-rk commentedStuck with the same problem. Any suggestions *exactly* where to change that line?
Interestingly, I thought this was a problem with XAMPP which I had installed locally. It uses PHP5. But, I uploaded the same set of files to my hosting server which runs php4> and never got this error.
Comment #8
stevryn commentedI also use XAMPP.
In phptemplate engine file look here:
This is what mine looks like now, and I do not get array errors anymore.
Comment #9
morbus iffWon't fix. This is a Civicspace theme issue (in 81rc, they were not returning an array through _phptemplate_variables, which caused the errors). In 82rc5, however, they ARE returning an array, so this error should go away. Regardless, forcing an array inside PHPTemplate isn't the answer: the template itself should take care to just follow the IO that PHPTemplate expects.