Author Topic: Cannot View/Edit/Add Tasks anymore!  (Read 1958 times)

robinmitra

  • Freshman
  • *
  • Posts: 32
    • View Profile
    • Email
Cannot View/Edit/Add Tasks anymore!
« on: January 23, 2011, 12:34:32 pm »
Hi

After a few hours of testing possibilities of tasks, the tasks have suddenly stopped working with the following message: "We are sorry, but Feng Office is not currently able to execute your request. An Error Report has been sent to the administrator."

Please note that the error only shows for my current user (admin) and tasks work fine for other users.

I have tried deleting browser cookies, cache files, copying installation files again but to no avail.

How to reproduce the error:
The error occurred after I was trying to filter tasks. I chose to filter using object type (subtask) but didn't select any subtask type from the next dropdown list. Then I chose status as Pending, and the error occurred.

The error only occurred only for the user who performed filtering as mentioned above. For the rest, tasks kept working. However, I was able to reproduce the error for other users as well after performing the filtering.

Error Log:
#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_on` = '0000-00-00 00:00:00' AND  ( ( `created_by_id` = 1)
     O' at line 1' - SELECT * FROM `og_project_tasks` WHERE `trashed_on` = '0000-00-00 00:00:00' AND (`is_template` = 0  AND  `object_subtype` = 1:1  AND `completed_on` = '0000-00-00 00:00:00' AND  ( ( `created_by_id` = 1)
     OR ( EXISTS ( SELECT * FROM `og_object_user_permissions` `xx_oup`
                WHERE `xx_oup`.`rel_object_id` = og_project_tasks.id
                   AND `xx_oup`.`rel_object_manager` = 'ProjectTasks'
                   AND `xx_oup`.`user_id` IN (1,10000000)
                   AND `xx_oup`.can_read = true) )
     OR ( EXISTS ( SELECT * FROM `og_project_users` `xx_pu`, `og_workspace_objects` `xx_wo`
                WHERE `xx_pu`.`user_id` IN (1,10000000)
                   AND `xx_pu`.`project_id` = `xx_wo`.`workspace_id`
                   AND `xx_wo`.`object_id` = og_project_tasks.id
                   AND `xx_wo`.`object_manager` = 'ProjectTasks'
                   AND `xx_pu`.can_read_tasks = true ) ) )  AND `trashed_by_id` = 0 AND `archived_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_on` = '0000-00-00 00:00:00' AND  ( ( `created_by_id` = 1)
     O' at line 1'' in E:\Projects\Personal\Web\feng_community\environment\library\database\adapters\AbstractDBAdapter.class.php:386
    Stack trace:
    #0 E:\Projects\Personal\Web\feng_community\environment\library\database\adapters\AbstractDBAdapter.class.php(304): AbstractDBAdapter->prepareAndExecute('SELECT * FROM `...', NULL)
    #1 E:\Projects\Personal\Web\feng_community\environment\library\database\DB.class.php(211): AbstractDBAdapter->executeAll('SELECT * FROM `...', NULL)
    #2 E:\Projects\Personal\Web\feng_community\environment\classes\dataaccess\DataManager.class.php(262): DB::executeAll('SELECT * FROM `...')
    #3 E:\Projects\Personal\Web\feng_community\application\models\ProjectDataObjects.class.php(31): DataManager->find(Array)
    #4 E:\Projects\Personal\Web\feng_community\application\models\project_tasks\base\BaseProjectTasks.class.php(205): ProjectDataObjects->find(Array)
    #5 E:\Projects\Personal\Web\feng_community\environment\classes\dataaccess\DataManager.class.php(299): BaseProjectTasks->find(Array)
    #6 E:\Projects\Personal\Web\feng_community\application\models\project_tasks\base\BaseProjectTasks.class.php(222): DataManager->findAll(Array)
    #7 E:\Projects\Personal\Web\feng_community\application\models\project_tasks\base\BaseProjectTasks.class.php(224): BaseProjectTasks->findAll(Array)
    #8 E:\Projects\Personal\Web\feng_community\application\controllers\TaskController.class.php(651): BaseProjectTasks->findAll(Array)
    #9 E:\Projects\Personal\Web\feng_community\environment\classes\controller\Controller.class.php(76): TaskController->new_list_tasks()
    #10 E:\Projects\Personal\Web\feng_community\environment\classes\controller\PageController.class.php(62): Controller->execute('new_list_tasks')
    #11 E:\Projects\Personal\Web\feng_community\environment\classes\Env.class.php(133): PageController->execute('new_list_tasks')
    #12 E:\Projects\Personal\Web\feng_community\init.php(163): Env::executeAction('task', 'new_list_tasks')
    #13 E:\Projects\Personal\Web\feng_community\index.php(9): require('E:\Projects\Per...')
    #14 {main}
Time since start: 0.2699658870697 seconds


I think that my particular way of filtering is producing illegal mysql output. But there must be a way to reset or clear the filter back to the original "unfiltered" state.

One solution could be recreating the user but its not the best or convenient solution IMHO.

Any help is greatly appreciated!

Robin

robinmitra

  • Freshman
  • *
  • Posts: 32
    • View Profile
    • Email
Re: Cannot View/Edit/Add Tasks anymore!
« Reply #1 on: January 23, 2011, 03:20:41 pm »
Hi

I have managed to get a temporary workaround after analysing the query string and mysql database entries.

The query generated is:
SELECT * FROM `og_project_tasks` WHERE `trashed_on` = '0000-00-00 00:00:00' AND (`is_template` = 0  AND  `object_subtype` = 1:1  AND `completed_on` ......

The `object_subtype` = 1:1 should have been '1:1'. In the database, I opened the table: og_user_ws_config_option_values and change the value of the record containing 1:1 with '1:1'. And it WORKED!

The source code for filtering tasks filtered using object_subtype should somewhere accommodate for the single quotes around the value. The source code is quite a bit for me to figure it out in one go, especially because I'm really busy these days. I would be great if a developer would correct this mistake.

If you need any help, I'm happy to assist.

PS: I have reported this bug in the bug tracking application.

Best Regards
Robin
« Last Edit: January 23, 2011, 03:36:21 pm by robinmitra »

supadoctor

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
    • Email
Re: Cannot View/Edit/Add Tasks anymore!
« Reply #2 on: January 24, 2011, 10:11:33 am »
What version of Feng Office do you use?

robinmitra

  • Freshman
  • *
  • Posts: 32
    • View Profile
    • Email
Re: Cannot View/Edit/Add Tasks anymore!
« Reply #3 on: January 25, 2011, 08:44:51 am »
I'm using version 1.7.3.1

franponce87

  • Administrator
  • Hero Member
  • *****
  • Posts: 1819
    • View Profile
    • Email
Re: Cannot View/Edit/Add Tasks anymore!
« Reply #4 on: February 02, 2011, 11:35:13 am »
Thanks for having reported it in the Bug Tracker as well as the fix for it.
We will look into it once we have time to fix it!

Best regards,
Francisco
Would you like to install Feng Office Professional or Enterprise Edition in your servers? No problem! Read this article!