Results 1 to 6 of 6

Thread: getDefaultPreference() called but not defined

  1. #1
    w00fy is offline Junior Member
    Join Date
    Apr 2009
    Location
    Wellington, New Zealand
    Posts
    2

    Default getDefaultPreference() called but not defined

    We are using Sugar CE Version 6.1.2 (Build 5555)

    This error started when I added a second user to the system.

    As background - a role wasn't applied to this user.

    Admin > User Mangement > [user name] > Access

    Showed that user having complete access to everything.

    When that user logged in they couldn't add or delete dashlets. With the following error message in the php logs:

    Code:
    [19-Mar-2011 14:37:26] PHP Warning:  array_unshift() [<a href='function.array-unshift'>function.array-unshift</a>]: The first argument should be an array in /home/www/example.com/include/MySugar/MySugar.php on line 114
    [19-Mar-2011 14:37:26] PHP Fatal error:  Call to undefined method UserPreference::isPreferenceSizeTooLarge() in /home/www/example.com/modules/Users/User.php on line 340
    [19-Mar-2011 14:37:26] PHP Warning:  require_once() [<a href='function.require-once'>function.require-once</a>]: Filename cannot be empty in /home/www/example.com/include/MySugar/MySugar.php on line 154
    [19-Mar-2011 14:37:26] PHP Fatal error:  require_once() [<a href='function.require'>function.require</a>]: Failed opening required '' (include_path='/home/www/example.com/include/..:.:/usr/share/php:/usr/share/pear') in /home/www/example.com/include/MySugar/MySugar.php on line 154
    In attempt to solve the dashlet problem we reset the user preferences for both users in the system. (The first user being the admin user that is set up during SugarCRM install).

    We reset the preferences by visiting.

    Admin > User Mangement > [user name] > Reset User Preferences

    Since resetting the user preferences when either user logs in they are redirected to this page:

    http://example.com/index.php?module=Users&action=Wizard

    With the following error message displayed in the browser.

    Fatal error: Call to undefined method UserPreference::getDefaultPreference() in /home/www/example.com/modules/Users/views/view.wizard.php on line 221

    I've spent some time researching the method UserPreference::getDefaultPreference and I've come to the conclusion that it is not defined anywhere in the Sugar code.

    I hope I'm wrong, which is why I am posting here.

    Here are the results of me grepping the code base:

    me@Computer:~/example.com$ grep getDefaultPreference `find . -name "*" 2> /dev/null` 2> /dev/null
    ./modules/Users/views/view.wizard.php: $this->ss->assign('TIMEOPTIONS', get_select_options_with_id($sugar_config['time_formats'], $current_user->_userPreferenceFocus->getDefaultPreference('default_time_format')));
    ./modules/Users/views/view.wizard.php: $this->ss->assign('DATEOPTIONS', get_select_options_with_id($sugar_config['date_formats'], $current_user->_userPreferenceFocus->getDefaultPreference('default_date_format')));

    I can login if I change the path to http://example.com/index.php after that login error screen.

    When I change the path I get prompted to set my time zone, then I'm good to go. All data present, except dashlets, which I can't change.

    So, can anyone help me get out of this sticky situation?

    I like dashlets, and seamless logins.

  2. #2
    darrylweaver is offline Junior Member
    Join Date
    Jun 2011
    Posts
    3

    Default Re: getDefaultPreference() called but not defined

    I am using Sugar 6.2.0 on a fresh install on Debian Squeeze 6.

    We have an admin user set up on install.

    I have then only logged in to customise the Accounts and Contacts modules in Studio.
    I have modified currencies and installed the British language pack.

    I have made all the field customisations needed for our install and I am ready to add users.

    However, I have exactly the same error as described here.

    Firstly, the dashlets didn't seem to work for adding and removing.
    So, I then reset the user preferences and home page for the admin user.

    From then on we had the issue with login that fails with the error:
    getDefaultPreference() called but not defined

    And also the inability to modify the dashlets on the Home page.

    Interestingly I did manage to modify one of the dashlets and add one of the ones we want, but now I have tried many times and adding always fails now with the error:
    require_once(): Failed opening required ''

    I have also tried using the quick repair and the repair dashlets, with no improvement.

    I do have restrictive permissions on the sugarcrm directories to stop the web server user being able to modify all the files, I have tried to make sure only write permissions are where they are needed, however, the error message does not indicate that permissions are a problem.

    Also reading other posts I thought it maybe something to do with the detault role, which I am not sure about, but I decided to create a test user and a role for the permissions we want to use and allocate the test user to this role.

    However, now, I can log in with the test user who has the same annoying login problem as above, then you change the URL and set the Timezone and can now get access, but there is only 1 SugarCRM website dashlet and I can still not add or remove any dashlets.

    I have also clicked on the User permissions button and Homepage button to reset these for the testuser and it actually reset everything for the admin user, which might be related or it might be an independent bug.

    I can set debug mode and post the output if it will be helpful.

  3. #3
    darrylweaver is offline Junior Member
    Join Date
    Jun 2011
    Posts
    3

    Default Re: getDefaultPreference() called but not defined

    The annoying login problem asking to set the timezone is avoided if the user goes into their preferences and saves the advanced screen with the timezone set.

    However, this does not fix the dashlets not being saved when modifications are made on the Home page.

    You can add dashlets and it says it is loading, but the dashlet doesn't appear.

    You can remove the 1 dashlet that is there, but if you refresh the page that change was not saved and it is back again.

  4. #4
    darrylweaver is offline Junior Member
    Join Date
    Jun 2011
    Posts
    3

    Default Re: getDefaultPreference() called but not defined

    I traced the problem to the British Language Pack:
    http://www.sugarforge.org/projects/uk-gb-eng-lang/

    To be fair this does only say it is for version 5.0.0a, but it does install in version 6.2.0.

    However, this then caused dashlets to stop working correctly.

    So, British Language Pack is incompatible with 6.2.0

  5. #5
    sallport is offline Member
    Join Date
    Jan 2008
    Posts
    9

    Default Re: getDefaultPreference() called but not defined

    Have you successfully been able to uninstall the en_gb language pack. I've tried on a clone install and now Sugar won't start.

    message:

    Warning: require_once(modules/UserPreferences/UserPreference.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/sites/default/sugarupg/include/utils/autoloader.php on line 73

    If so, what steps did you take?

  6. #6
    sallport is offline Member
    Join Date
    Jan 2008
    Posts
    9

    Default Re: getDefaultPreference() called but not defined

    I fixed the problem after unistalling the en_gb language pack by extracting the stock surgarcrm installation zip file on top of the broken installation. Obviously some files had be altered during the installation of the language pack.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. what event needs to be called?
    By esplgopal in forum Developer Help
    Replies: 2
    Last Post: 2009-02-13, 09:31 AM
  2. Are they called modules?
    By rightfoot in forum General Discussion
    Replies: 4
    Last Post: 2008-12-11, 05:04 AM
  3. What is this layout called
    By normdouglas in forum Developer Tutorials
    Replies: 2
    Last Post: 2008-10-02, 04:26 PM
  4. Not sure what this is called...
    By jcolinger3 in forum Help
    Replies: 2
    Last Post: 2008-05-24, 08:06 PM
  5. Search accounts not Called/not called within x days
    By ChocolateLover in forum Developer Help
    Replies: 0
    Last Post: 2007-02-20, 03:15 PM

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
  •