Author Topic: Error trying to open tasks tab while logged in as administator  (Read 3637 times)

intellect22

  • Newbie
  • *
  • Posts: 4
    • View Profile
Error trying to open tasks tab while logged in as administator
« on: September 15, 2009, 04:00:56 pm »
I ahve been using opengoo for about a  week now and it is pretty cool. All of a sudden today I go to check on my tasks, click on the tasks tab and get this error:

We are sorry, but OpenGoo is not currently able to execute your request. An Error Report has been sent to the administrator.

so I looked around the net and could not find a solution, but I did see to post the log file description so here it is, does anyone know how I can fix this?


Error from log file:


#1 DEBUG: SQL ERROR: Query failed with message 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':1  AND `completed_by_id` = 0  AND  `id` IN (SELECT `object_id` FROM `og_workspa' at line 1' - SELECT * FROM `og_project_tasks` WHERE `trashed_by_id` = 0 AND (`is_template` = 0  AND  `completed_by_id` = 1:1  AND `completed_by_id` = 0  AND  `id` IN (SELECT `object_id` FROM `og_workspace_objects` WHERE `object_manager` = 'ProjectTasks' AND `workspace_id` IN (SELECT `og_project_users`.`project_id` FROM `og_project_users` WHERE ((`og_project_users`.`user_id` = '1') OR (`og_project_users`.`user_id` IN (SELECT `group_id` FROM `og_group_users` WHERE `og_group_users`.`user_id` = '1')))))  AND `trashed_by_id` = 0) ORDER BY created_on DESC LIMIT 0, 501

#2 FATAL: exception 'DBQueryError' with message 'Query failed with message 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':1  AND `completed_by_id` = 0  AND  `id` IN (SELECT `object_id` FROM `og_workspa' at line 1'' in /home/(edited out for security)/public_html/(edited out)/base/environment/library/database/adapters/AbstractDBAdapter.class.php:386

    Stack trace:

    #0 /home/(edited out for security)/public_html/(edited out)/base/environment/library/database/adapters/AbstractDBAdapter.class.php(304): AbstractDBAdapter->prepareAndExecute('SELECT * FROM `...', NULL)

    #1 /home/(edited out for security)/public_html/(edited out)/base/environment/library/database/DB.class.php(209): AbstractDBAdapter->executeAll('SELECT * FROM `...', NULL)

    #2 /home/(edited out for security)/public_html/(edited out)/base/environment/classes/dataaccess/DataManager.class.php(253): DB::executeAll('SELECT * FROM `...')

    #3 /home/(edited out for security)/public_html/(edited out)/base/application/models/ProjectDataObjects.class.php(31): DataManager->find(Array)

    #4 /home/(edited out for security)/public_html/(edited out)/base/application/models/project_tasks/base/BaseProjectTasks.class.php(201): ProjectDataObjects->find(Array)

    #5 /home/(edited out for security)/public_html/(edited out)/base/environment/classes/dataaccess/DataManager.class.php(281): BaseProjectTasks->find(Array)

    #6 /home/(edited out for security)/public_html/(edited out)/base/application/models/project_tasks/base/BaseProjectTasks.class.php(218): DataManager->findAll(Array)

    #7 /home/(edited out for security)/public_html/(edited out)/base/application/models/project_tasks/base/BaseProjectTasks.class.php(220): BaseProjectTasks->findAll(Array)

    #8 /home/(edited out for security)/public_html/(edited out)/base/application/controllers/TaskController.class.php(540): BaseProjectTasks->findAll(Array)

    #9 /home/(edited out for security)/public_html/(edited out)/base/environment/classes/controller/Controller.class.php(76): TaskController->new_list_tasks()

    #10 /home/(edited out for security)/public_html/(edited out)/base/environment/classes/controller/PageController.class.php(62): Controller->execute('new_list_tasks')

    #11 /home/(edited out for security)/public_html/(edited out)/base/environment/classes/Env.class.php(133): PageController->execute('new_list_tasks')

    #12 /home/(edited out for security)/public_html/(edited out)/base/init.php(149): Env::executeAction('task', 'new_list_tasks')

    #13 /home/(edited out for security)/public_html/(edited out)/base/index.php(9): require('/home/(edited out for security)/pu...')

    #14 {main}

afokapu

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Error trying to open tasks tab while logged in as administator
« Reply #1 on: September 16, 2009, 06:57:41 pm »
Hi,

I got exactly the same issue . it comes when you do cascading filtering without filling the filed in the proper order (i.e. from left to right, one by one).
In other words, let say you want to filter the taks based on criteria from the 3 comboxes:
(Combobox  a) - created by
(Combobox  b) - User1
(Combobox  c) - Completed

You will have to choose your criteria in the following order: Combobox a then b and finally c.

If you do no respect the order, then the error might appears. I say might because it is not an exact science. Honestly I tried it 3 times and it occurs 2. Don't know why.

Anyway,

Here below a (really!) dirty way to tournaround this issue.

1/ Log into opengoo with the user who faces this issue.
2/ Edit the following file (using FTP access) :
[server] /opengoo /environment /library /database /adapters/AbstractDBAdapter.class.php      
3/ Edit line 385-386 like this
BEFORE:  if($query_result === false) {
throw new DBQueryError($sql, $this->lastErrorCode(), $this->lastError());
}
AFTER: if($query_result === false) {}
Save
4/ Go back to opengoo , refresh and change the filtering criteria
5/ Go back to the file you modified (using FTP access):
Edit line 385-386 back to its initial state with the command in the bracket.

You're done

What we basically do, is to prevent the SQL error to appear and hide the filtering Combobox. This allows us to correct the bad filtering.

Regards,


« Last Edit: September 16, 2009, 10:52:25 pm by afokapu »

intellect22

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Error trying to open tasks tab while logged in as administator
« Reply #2 on: September 16, 2009, 10:32:13 pm »
Right sorry, I forgot to mention that I was logged in as administrator as well. I logged in from the same computer under a test user and the tasks tab worked just fine, it also works for my employees. So the issue only seems to be effecting my administrator login....

afokapu

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Error trying to open tasks tab while logged in as administator
« Reply #3 on: September 16, 2009, 10:57:12 pm »
I gave you my no perfect "solution" in my post upper (i modified the precedent which was basically the same as yours).

Try it and keep us updated.

By the way, the issue only affect the user who do the filtering (lucky us).
« Last Edit: September 16, 2009, 10:59:44 pm by afokapu »

afokapu

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Error trying to open tasks tab while logged in as administator
« Reply #4 on: September 16, 2009, 11:01:02 pm »
Two newbies helping each other  ;)

Where are the expert when we need them? ;D

intellect22

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Error trying to open tasks tab while logged in as administator
« Reply #5 on: September 17, 2009, 05:59:17 am »
Sorry did not see your reply until right now! Ok tried your suggestion...commented out the line so it was "blank" and when I clicked on the tasks tab IT WORKED!!!......BUT it was blank showing that there were no tasks....doh. Any other ideas? :)

My issue comes when I click on the tasks tab in general, not when I try to organize them. fyi.

afokapu

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Error trying to open tasks tab while logged in as administator
« Reply #6 on: September 17, 2009, 06:25:48 am »
OK,

So now, you have to change/play with the filetring combobox and your tasks should appear.

if not, remove all the filter criterias.

if not, play around with the others option (milestones, etc...) something should happens.

Note: my understanding is that: when you click on the Task Tab, it's automatically call a SQL request based on the parameters on top related to sorting  & filtering. If the paramaters of that request are innapropriate (as in the example with the filtering upper) then you will get the error message.
To avoid this, and still be able to modify the innapropraite parameters sent to the SQL request; you must prevent the task bar to display the error message and let you change the parameters.
I don't know if make myself perfectly clear?

intellect22

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Error trying to open tasks tab while logged in as administator
« Reply #7 on: September 17, 2009, 03:07:18 pm »
Awesome! You were right, if I set it to no filter my tasks show up. Thank a million, at least someone is on here helping people!