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

sirkitree - May 10, 2008 - 17:06
Status:active» won't fix

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

If this is not an option for you try changing:

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

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

#2

stormer - May 13, 2008 - 02:01
Status:won't fix» fixed

Thanks, that did the trick.

#3

smccabe - May 15, 2008 - 17:04

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:

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

AttachmentSize
activity-256897-3.patch613 bytes

#4

smccabe - May 15, 2008 - 18:08

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

jaydub - May 19, 2008 - 05:41

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

Anonymous (not verified) - June 2, 2008 - 05:42
Status:fixed» closed

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

#7

tasigurl - July 1, 2008 - 05:29

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

 
 

Drupal is a registered trademark of Dries Buytaert.