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.

CommentFileSizeAuthor
#3 activity-256897-3.patch613 bytessmccabe

Comments

sirkitree’s picture

Status: Active » Closed (won't fix)

“chaining” syntax is PHP5 only. Please upgrade your PHP version.

If this is not an option for you try changing:

  if (db_fetch_object($result)->count != 0) {
    return FALSE;
  }

to

  $acount = db_fetch_object($result);
  if ($acount->count != 0) {
    return FALSE;
  }
stormer’s picture

Status: Closed (won't fix) » Fixed

Thanks, that did the trick.

smccabe’s picture

StatusFileSize
new613 bytes

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.

<?php
  if (db_fetch_object($result)->count != 0) {
    return FALSE;
  }
?>

to:

  if (count(db_fetch_object($result)) != 0) {
    return FALSE;
  }
smccabe’s picture

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

jaydub’s picture

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...

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

tasigurl’s picture

I'm getting the same erroe message. Also I'm using php4. Which file in the module do i paste the code?