Author Topic: Error: Query failed with message 'Duplicate entry '54-1' for key 1'  (Read 1988 times)

tek12

  • Guest
I'm trying to change my default workspace and every time I hit save I receive this error:

Error: Query failed with message 'Duplicate entry '54-1' for key 1'

I get the same error every workspace, except that the entry numbers change....

My account is the administrative account, and I have full permissions on the workspaces I am trying to change to. I have also tried this with one of the user accounts, and I also get the same error there as well.

I've been using the drop down dialog in:
Administration --> Users --> Update Profile --> Administrative Options --> Personal Workspace

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I've tried debug true as suggested, but this gives no extra information and actually I tail -f log.php and there is no output when this occurs - there is output for everything else however. But, none during this error.

On the client side, it's Firefox 3.5.6 on Ubuntu 9.10 - server side is ubuntu 8.04, php 5.2.4, mysql 5.0.51 and the latest Feng Office 1.6.

I started with opengoo 1.5, but never noticed this problem - also didn't have many users on that system either. This is a clean install in that I started by dumping the mysql db from the old opengoo 1.5, creating a new install with feng office 1.6 and importing the db. For testing reasons I wanted to have two instances.

Any help would be greatly appreciated. My administrative user's default work space is shared with several other people, which is not an ideal situation. Thanks!

alvarotm01

  • Administrator
  • Sr. Member
  • *****
  • Posts: 335
    • View Profile
    • Email
Re: Error: Query failed with message 'Duplicate entry '54-1' for key 1'
« Reply #1 on: December 29, 2009, 02:03:25 pm »
Hi,

to fix that, replace lines 127 to 131 of /application/controllers/AccountController.class.php
with these ones
Code: [Select]
$project_user = ProjectUsers::findById(array('project_id' => $project->getId(), 'user_id' => $user->getId()));
if (!$project_user) {
$project_user = new ProjectUser();
$project_user->setAllPermissions(true);
$project_user->setUserId($user->getId());
$project_user->setProjectId($project->getId());
$project_user->save();
}

regards

tek12

  • Guest
Re: Error: Query failed with message 'Duplicate entry '54-1' for key 1'
« Reply #2 on: December 29, 2009, 03:45:13 pm »
worked like a charm... thank you very much.

Daniel