Author Topic: Suddenly a white page is displayed  (Read 4043 times)

tokolito

  • Newbie
  • *
  • Posts: 3
    • View Profile
Suddenly a white page is displayed
« on: November 26, 2008, 02:43:12 pm »
Every time I try to login, I see a white page.
Apache error log shows:

PHP Fatal error:  Call to a member function canView() on a non-object in
/opengoo/application/models/comments/Comments.class.php on line 74

This is only happening to my user (which is a admin) all other user can login without problem.

I tried this in firefox and safari, deleted cookies, without success.

Can anyone help?

Thanks.

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: Suddenly a white page is displayed
« Reply #1 on: November 26, 2008, 05:50:32 pm »
Hi,

Change line 74 of application/models/comments/Comments.class.php from:

Code: [Select]
if ($comment->getObject()->canView($user)) {
to:

Code: [Select]
$object = $comment->getObject();
if ($object instanceof ApplicationDataObject && $object->canView($user)) {

Did you upgrade your OpenGoo from a previous version or is it a fresh install?

Thanks.

kitkatneko

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Suddenly a white page is displayed
« Reply #2 on: December 24, 2008, 12:56:10 pm »
The very same thing happened to me.
I did not perform any upgrade or anything just installed v1 a while ago
Since then I used opengoo quite often and it just stopped working giving a blank page after login.

Enabled the debug mode showed that error.

the given fix solved the issue. Thanks.

what changed in between?

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: Suddenly a white page is displayed
« Reply #3 on: December 26, 2008, 10:31:50 am »
It seems that a comment was left on the database without its associated object. When deleting an object all comments are supposed to be deleted so I don't know how this happened. The above fix checks for the existence of the associated object before trying to access it.

kitkatneko

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Suddenly a white page is displayed
« Reply #4 on: December 28, 2008, 09:53:38 am »
I suppose this is exactly what happened as I remember now deleted a lot of tasks (year end!) and some had comments.

I am running 1.0.

773

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Suddenly a white page is displayed
« Reply #5 on: January 21, 2009, 01:01:51 am »
I'm now getting something very similar to this in my v1.1 - error message is:

Fatal error: Call to a member function getDisplayName() on a non-object in /var/www/html/projects/application/models/project_milestones/ProjectMilestone.class.php on line 279

so the error comes in the middle of the definition of getAssignedToName()  :

Code: [Select]
function getAssignedToName() {
if($this->getAssignedToUserId() > 0) {
return $this->getAssignedToUser()->getDisplayName();
} elseif($this->getAssignedToCompanyId() > 0) {
return $this->getAssignedToCompany()->getName();
} else {
return lang("anyone");
} // if
} // getAssignedToName

Anyone have any suggestions as to what to do? I'm totally out of my depth at this point, and I can't relate the code changes necessary to solve tokolito's problem to the code I have above. Any help appreciated! I'm pretty lost now without being able to project manage myself...


 

anything