Results 1 to 5 of 5

Thread: Call to a member function add() on a non-object in some files

  1. #1
    mlof is offline Junior Member
    Join Date
    Oct 2009
    Posts
    1

    Question Call to a member function add() on a non-object in some files

    Hello, I am installing sugarcrm SugarCRM 5.2.0j PHP ver 5.2.6 MySql ver 5.0.67
    On the prepare stage everything goes fine, but when creating database stage begins I catch the following fatal error messages on some files like
    "function add() on a non-object in SugarBean.php"
    "Call to a member function add() on a non-object in /usr/local/share/SugarCE-Full-5.2.0j/install/populateSeedData.php"

    I`ve just commented out the strings where errors have arrised.
    In populateSeedData.php it was "$email->contacts->add($contact->id);" string
    In SugarBean.php it was "$this->$rel_name->add($this->$id); string "
    But allways error with add() function.
    Is something wrong with my system or it is "Sugar" Bugs?

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,334

    Default Re: Call to a member function add() on a non-object in some files

    It seems the relationship between emails and contacts had not been created.
    Try erasing database and installation and try again.

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    ConFliX is offline Senior Member
    Join Date
    Aug 2009
    Posts
    25

    Default Re: Call to a member function add() on a non-object in some files

    I am having a similar problem but I am currently using 5.5, I'm trying to create a one-to-one relationship between two modules. I can create the relationship fine, but when I go to test it and assign one module to the other and click "Save" it throws the message:

    Fatal error: Call to a member function add() on a non-object in /var/www/sugardev/dev5.5/data/SugarBean.php on line 1896

    My sugarcrm.log file also outputs multiple times:
    Tue Jan 5 11:39:56 2010 [402][1][FATAL] Error fetching relationship from cache tn_templates_tn_groups

    I have tried to Rebuild relationships and Rebuild DB, but nothing seems to work properly.

    I've also tried completely deleting the modules and package, as well as any information regarding these modules in the custom directory, to no avail. I've also deleted the upgrade_history record and the cache/upload/upgrades/module information that was mentioned in one of eggsurpluses posts.

    If anyone has any ideas, I would be very grateful, I've been stuck on this problem for the past few days.



    Thanks,

    Brian

  4. #4
    ConFliX is offline Senior Member
    Join Date
    Aug 2009
    Posts
    25

    Default Re: Call to a member function add() on a non-object in some files

    Does anyone have any ideas of how to fix this?

  5. #5
    philos is offline Member
    Join Date
    Dec 2009
    Posts
    5

    Default Re: Call to a member function add() on a non-object in some files

    mv cache cache.bak
    mkdir cache
    chmod -R 777 cache

    And go to your browser and reload. Hope that helps.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 9
    Last Post: 2012-01-10, 10:36 AM
  2. Replies: 8
    Last Post: 2010-01-19, 01:41 AM
  3. Replies: 2
    Last Post: 2008-02-27, 09:34 PM
  4. Replies: 4
    Last Post: 2006-09-26, 02:21 PM
  5. Replies: 0
    Last Post: 2005-12-18, 08:16 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •