I got this error :

Fatal error: Call to a member function setMode() on a non-object in /sites/all/modules/arphp/modules/arphp_date/arphp_date.module on line 134

CommentFileSizeAuthor
#2 arphp_date-813026.patch682 byteshomoludens

Comments

Marat’s picture

Also I got these errors:

# warning: Missing argument 1 for Arabic::__construct(), called in /sites/all/modules/arphp/modules/arphp_date/arphp_date.module on line 780 and defined in /sites/all/modules/arphp/arphp/Arabic.php on line 98.
# warning: Missing argument 1 for Arabic::__construct(), called in /sites/all/modules/arphp/modules/arphp_date/arphp_date.module on line 133 and defined in /sites/all/modules/arphp/arphp/Arabic.php on line 98.
# warning: Missing argument 1 for Arabic::__construct(), called in /sites/all/modules/arphp/modules/arphp_date/arphp_date.module on line 133 and defined in /sites/all/modules/arphp/arphp/Arabic.php on line 98 
homoludens’s picture

StatusFileSize
new682 bytes

I changed lines 133 and 134 from

      $Ar = new Arabic();
      $Ar->ArDate->setMode($formatter->mode);

to

      $Ar = new Arabic('ArDate');
      $Ar->setMode($formatter->mode);

based on examples on: http://www.ar-php.org/Online/live-demo.php.

Didn't yet tested across the site, but I have lost the errors

homoludens’s picture

Status: Active » Needs review
rami.sedhom’s picture

Status: Needs review » Active

I got this error when I tried to see the Date Setting (admin/settings/date-time)

Fatal error: Call to a member function setMode() on a non-object in /home2/lekaaorg/public_html/emanwanour/sites/all/modules/arphp/modules/arphp_date/arphp_date.module on line 787

rami.sedhom’s picture

Title: Fatal error in arphp_date.module on line 134 » Fatal error in arphp_date.module on line 134

I had changed line 780 from:

$Ar = new Arabic();?

to:

$Ar = new Arabic('ArDate');

and line 787 from:

$Ar->ArDate->setMode($mode);

to:

$Ar->setMode($mode);

This is in addition to the changes recommended by homoludens in comment #2. Now, no more errors with me.

BUT, it doesn't work unless I change lines 514 and 515 as well in the same way. Now it works with me.

majdi’s picture

Hello,
I did the patch in #2 also I apply the changes in #5 , I start getting this error

Fatal error: Cannot redeclare class ArDate in public_html/sites/all/modules/arphp/arphp/sub/ArDate.class.php on line 171

This error because of the class arDate is included twice , i fix it by include the whole class in to this if statement

 if(class_exists('ArDate') != true)
{

class ArDate
{
    protected $mode = 1;
    protected $xml  = null;

    protected static $islamicEpoch = 1948439.5;
.........
}
}

This is temporary solution until I find what is the problem