Author Topic: SQL Error  (Read 49116 times)

crossmeadow

  • Newbie
  • *
  • Posts: 3
    • View Profile
SQL Error
« on: March 03, 2015, 05:30:23 am »
Dearest Community
I have a huge problem because I have no glue how to handle this error. Of course i know what SQL is but no experince in dogfighting it.

Quote
Session "default" started at 2015-03-03T07:50:32+0000

#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 'parent_id` = 0' at line 17' -

                SELECT  COUNT(o.id) AS total  FROM fo_objects o

                 INNER JOIN  fo_project_tasks e ON e.object_id = o.id

                

                WHERE

                   o.id IN (

                   SELECT sh.object_id FROM fo_sharing_table sh

                   WHERE o.id = sh.object_id

                   AND sh.group_id  IN (15)

             )

                   AND   (EXISTS (SELECT om.object_id

                   FROM  fo_object_members om

                   WHERE   om.member_id IN (15) AND o.id = om.object_id

                   GROUP BY object_id

                   HAVING count(member_id) = 1

             ))

                   AND o.object_type_id = 5

                   AND `o`.`trashed_on` = '0000-00-00 00:00:00' AND `o`.`archived_on` = '0000-00-00 00:00:00' AND `e`.`is_template` = 0      AND ` AND `parent_id` = 0

                

                

                

#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 'parent_id` = 0' at line 17'' in /home/dmvideoe/public_html/feng/environment/library/database/adapters/AbstractDBAdapter.class.php:392

    Stack trace:

    #0 home/dmvideoe/public_html/feng/environment/library/database/adapters/AbstractDBAdapter.class.php(310): AbstractDBAdapter->prepareAndExecute('??????SELECT  C...', NULL)

    #1 home/dmvideoe/public_html/feng/environment/library/database/DB.class.php(213): AbstractDBAdapter->executeAll('??????SELECT  C...', NULL)

    #2 home/dmvideoe/public_html/feng/application/models/ContentDataObjects.class.php(543): DB::executeAll('??????SELECT  C...')

    #3 home/dmvideoe/public_html/feng/application/controllers/TaskController.class.php(1046): ContentDataObjects->listing(Array)

    #4 home/dmvideoe/public_html/feng/application/controllers/TaskController.class.php(1732): TaskController->getDateGroups('created_on', 'AND `e`.`is_tem...', Array, ' AND `parent_id...')

    #5 home/dmvideoe/public_html/feng/application/controllers/TaskController.class.php(1787): TaskController->getGroups('created_on', 'AND `e`.`is_tem...', Array)

    #6 home/dmvideoe/public_html/feng/environment/classes/controller/Controller.class.php(76): TaskController->get_tasks_groups_list()

    #7 home/dmvideoe/public_html/feng/environment/classes/controller/PageController.class.php(62): Controller->execute('get_tasks_group...')

    #8 home/dmvideoe/public_html/feng/environment/classes/Env.class.php(129): PageController->execute('get_tasks_group...')

    #9 home/dmvideoe/public_html/feng/init.php(174): Env::executeAction('task', 'get_tasks_group...')

    #10 home/dmvideoe/public_html/feng/index.php(9): require('/home/dmvideoe/...')

    #11 {main}

Time since start: 1.0499858856201 seconds

Please give advice, help and patience like it's your own feng-office-baby! I would owe you one! ^^

MiKonst

  • Freshman
  • *
  • Posts: 41
    • View Profile
Re: SQL Error
« Reply #1 on: March 03, 2015, 08:11:25 am »
this variable "parent_id" is used in areas of workspaces assignment. The assignment is on the table "fo_sharing_table".
1. Test please first check all tables in the data base by, optimize, repair with phpMyAdmin
2. in FO go in admin area to workspaces and all workspaces check for assignment

Hope it helps you

crossmeadow

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: SQL Error
« Reply #2 on: March 03, 2015, 08:33:15 am »

Everything helps.. i don't find "parent_id".. I do my best but after all I am just a noob.. first contact with sql! =)

Can you help me one more time? =)

MiKonst

  • Freshman
  • *
  • Posts: 41
    • View Profile
Re: SQL Error
« Reply #3 on: March 03, 2015, 09:20:29 am »
"parent_id" is variable in php and not a table field.
There is another problem with assigning work areas unless the error in php code in Taskcontroller.class.php
Look here please:
http://forum.fengoffice.com/index.php?topic=20119.0
« Last Edit: March 03, 2015, 09:24:19 am by MiKonst »

crossmeadow

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: SQL Error
« Reply #4 on: March 03, 2015, 09:49:21 am »
Thank you very very much! =) This solved the problem!!! Great job! =)

I found a fix for version 3.1:

look for line number 1119 in the file application/controllers/TaskController.class.php

change:
$date_groups['conditions'] = $condition;

to:
$group_2['conditions'] = $condition;