Author Topic: "500 Internal server error" when adding new contact in OpenGoo 1.4.1  (Read 5954 times)

raboof

  • Newbie
  • *
  • Posts: 27
    • View Profile
Hello folks,

After upgrading to 1.4.1, "Add new contact" does not work anymore. When New -> Contact
is pressed, the speech bubble appears with "Error 500: Internal Server Error". In the
server logs, this error appears:

FastCGI sent in stderr: "PHP Catchable fatal error:  Argument 2 passed to Contact::canAdd() must be an instance of Project, null given, called in /myroot/application/controllers/ContactController.class.php on line 541 and defined in /myroot/application/models/contacts/Contact.class.php on line 674" while reading response header from upstream, client: 1.2.3.4, server: foo.com, request: "GET /?active_project=0&ajax=true&c=contact&a=add&current=contacts-panel&_dc=1243704572000 HTTP/1.1", upstream: "fastcgi://unix:/tmp/nginx-phpfastcgi.socket:", host: "foo.com", referrer: "http://foo.com/index.php?c=access&a=index"

The "New -> company" does not give error instead.

alvarotm01

  • Administrator
  • Sr. Member
  • *****
  • Posts: 335
    • View Profile
    • Email
Re: "500 Internal server error" when adding new contact in OpenGoo 1.4.1
« Reply #1 on: June 01, 2009, 10:08:35 am »
Hi,
to fix this try editing 'application/models/contacts/Contact.class.php' in line 674, remove thw word 'Project' to avoid php checking types.

joew

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: "500 Internal server error" when adding new contact in OpenGoo 1.4.1
« Reply #2 on: June 01, 2009, 10:27:49 am »
Actually, I get the same thing.  I notice I can create a contact "inside" a workspace, but when I try to create a contact when selecting "All", I get the 500 error.

Removing the "Project" text did not help...   Anything else we can try?

/joe

alvarotm01

  • Administrator
  • Sr. Member
  • *****
  • Posts: 335
    • View Profile
    • Email
Re: "500 Internal server error" when adding new contact in OpenGoo 1.4.1
« Reply #3 on: June 01, 2009, 12:37:56 pm »
Ok,
leave Contact.class.php like it was before.
In 'application/controllers/ContactController.class.php' change line 541
Code: [Select]
if(!Contact::canAdd(logged_user(),active_project())) {for this one
Code: [Select]
if(!(active_project() instanceof Project ? Contact::canAdd(logged_user(),active_project()) : can_manage_contacts(logged_user()))) {
hope this helps

raboof

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: "500 Internal server error" when adding new contact in OpenGoo 1.4.1
« Reply #4 on: June 02, 2009, 11:41:45 am »
I confirm this change of the if condition fixes.
Thank you

soj

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: "500 Internal server error" when adding new contact in OpenGoo 1.4.1
« Reply #5 on: June 11, 2009, 08:25:32 am »
Thanks Alva that fixed my problem.