Yii Framework Forum: Help needed - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Help needed Help needed to fix my site Rate Topic: -----

#1 User is offline   bilpin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 07-August 17

Posted 07 August 2017 - 10:27 PM

Hello friends
Could anyone suggest or help me to fix this website
I dont know what is going on with the errors !!!!

I am getting the error as

PHP Fatal Error – yii\base\ErrorException
Call to a member function getId() on null

1. in /home/hakumaicha/public_html/common/models/Notification.php at line 45
36373839404142434445464748495051525354

$moder->notification_type = $type;
$moder->message = $msg;
$moder->user_id = $for;
$moder->time = time();
$moder->save(false);
return true;
}
public static function TotalNotification()
{
$uid =Yii::$app->user->identity->getId();
$count = Notification::find()->where(['user_id'=>$uid])->andWhere(['flag'=>"0"])->count();
if($count > 0)
{
return "<sup>".$count."</sup>";;
}
else{
return null;
}


2. yii\base\ErrorHandler::handleFatalError()

$_COOKIE = [
'PHPFRONTSESSID' => '5e39e34f83ec36f569f3c96f62417b09',
'timezone' => 'Australia/Sydney',
];

$_SESSION = [
'__flash' => [],
];
0

#2 User is offline   Jacques 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 26-August 12

Posted 08 August 2017 - 07:05 AM

Hi,

The id column of your table is probably not set to generate the primary key automatically. If you are using MySQL set AUTO_INCREMENT property of id column.


View Postbilpin, on 07 August 2017 - 10:27 PM, said:

Hello friends
Could anyone suggest or help me to fix this website
I dont know what is going on with the errors !!!!

I am getting the error as

PHP Fatal Error – yii\base\ErrorException
Call to a member function getId() on null

1. in /home/hakumaicha/public_html/common/models/Notification.php at line 45
36373839404142434445464748495051525354

$moder->notification_type = $type;
$moder->message = $msg;
$moder->user_id = $for;
$moder->time = time();
$moder->save(false);
return true;
}
public static function TotalNotification()
{
$uid =Yii::$app->user->identity->getId();
$count = Notification::find()->where(['user_id'=>$uid])->andWhere(['flag'=>"0"])->count();
if($count > 0)
{
return "<sup>".$count."</sup>";;
}
else{
return null;
}


2. yii\base\ErrorHandler::handleFatalError()

$_COOKIE = [
'PHPFRONTSESSID' => '5e39e34f83ec36f569f3c96f62417b09',
'timezone' => 'Australia/Sydney',
];

$_SESSION = [
'__flash' => [],
];

0

#3 User is offline   rjinfosys 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 26-June 13
  • Location:India

Posted 09 August 2017 - 05:05 AM

I was reviewed your requirement on freelancer website (https://www.freelanc...ii-development/)
I am Yii developer and I was check your website its many bugs are there so if you are looking for Yii developer reply me I am looking for long term business relation with your.

Looking for your positive reply.

View Postbilpin, on 07 August 2017 - 10:27 PM, said:

Hello friends
Could anyone suggest or help me to fix this website
I dont know what is going on with the errors !!!!

I am getting the error as

PHP Fatal Error – yii\base\ErrorException
Call to a member function getId() on null

1. in /home/hakumaicha/public_html/common/models/Notification.php at line 45
36373839404142434445464748495051525354

$moder->notification_type = $type;
$moder->message = $msg;
$moder->user_id = $for;
$moder->time = time();
$moder->save(false);
return true;
}
public static function TotalNotification()
{
$uid =Yii::$app->user->identity->getId();
$count = Notification::find()->where(['user_id'=>$uid])->andWhere(['flag'=>"0"])->count();
if($count > 0)
{
return "<sup>".$count."</sup>";;
}
else{
return null;
}


2. yii\base\ErrorHandler::handleFatalError()

$_COOKIE = [
'PHPFRONTSESSID' => '5e39e34f83ec36f569f3c96f62417b09',
'timezone' => 'Australia/Sydney',
];

$_SESSION = [
'__flash' => [],
];

Thanks :)
RJS

skype:rjinfosys
gtalk:rjinfosysinc


0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users