Parse Error
stormer - May 10, 2008 - 10:59
| Project: | Activity |
| Version: | 5.x-3.0-beta2 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
Hi,
I've installed the Activity module on my site but whenever I activate the module I get the following error:
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /nfs/c02/h02/mnt/26164/domains/demos.kitsunedigital.com/html/cleftworld/sites/all/modules/activity/activity.module on line 202
Drupal 5.7
MySQL database 4.1.11
PHP 4.4.8
Thanks in advance for any help in this matter.

#1
“chaining” syntax is PHP5 only. Please upgrade your PHP version.
If this is not an option for you try changing:
<?phpif (db_fetch_object($result)->count != 0) {
return FALSE;
}
?>
to
<?php$acount = db_fetch_object($result);
if ($acount->count != 0) {
return FALSE;
}
?>
#2
Thanks, that did the trick.
#3
couldn't we just do something like this? then it works for both 4 and 5 and still don't need the extra variable? It's just a syntax change. I have a patch already done if you want.
<?phpif (db_fetch_object($result)->count != 0) {
return FALSE;
}
?>
to:
<?phpif (count(db_fetch_object($result)) != 0) {
return FALSE;
}
?>
#4
ahhh nevermind, count() doesn't work because count(*) in the select statement still returns a value, i didn't read the select statement closely enough, just use sirkitree's solution above
#5
I didn't realize that chaining was specific to php5 :( please please please
will everyone just ditch php4?
When I get a chance I'll remove the php5 chaining method for
a compatible method...
#6
Automatically closed -- issue fixed for two weeks with no activity.
#7
I'm getting the same erroe message. Also I'm using php4. Which file in the module do i paste the code?