Author Topic: error adding Time  (Read 4599 times)

kikobono

  • Newbie
  • *
  • Posts: 3
    • View Profile
error adding Time
« on: March 19, 2009, 02:58:58 pm »
Hi guys.
I've just updated from 1.2.1 (working) to 1.3.

In "Time" tab, when I try to add/update a timeslot, the system gives me a mysql error, that is:

Query failed with message 'You have an error in your SQL syntax; check the manual the corresponds to your MySQL server versione for the right sintax to use near '' at line 1'

Do you have any clue?


atdiehm

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: error adding Time
« Reply #1 on: March 20, 2009, 02:29:58 pm »
The debug output follows, I have the same problem.

It apparently is trying to do something with billing, yet, I have no billing set up, so there is no ID, causing the error...

Adam





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 '' at line 1'
Error params:
File:    /home/goo/public_html/environment/library/database/adapters/AbstractDBAdapter.class.php
Line:    386
Sql:    SELECT * FROM `og_workspace_billings` WHERE project_id = '28' AND billing_id =
Error number:    1064
Error 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 '' at line 1
Backtrace:
#0 /home/goo/public_html/environment/library/database/adapters/AbstractDBAdapter.class.php(304): AbstractDBAdapter->prepareAndExecute('SELECT * FROM `...', NULL)
#1 /home/goo/public_html/environment/library/database/DB.class.php(199): AbstractDBAdapter->executeAll('SELECT * FROM `...', NULL)
#2 /home/goo/public_html/environment/classes/dataaccess/DataManager.class.php(182): DB::executeAll('SELECT * FROM `...')
#3 /home/goo/public_html/application/models/workspace_billing/base/BaseWorkspaceBillings.class.php(112): DataManager->find(Array)
#4 /home/goo/public_html/environment/classes/dataaccess/DataManager.class.php(228): BaseWorkspaceBillings->find(Array)
#5 /home/goo/public_html/application/models/workspace_billing/base/BaseWorkspaceBillings.class.php(146): DataManager->findOne(Array)
#6 /home/goo/public_html/application/models/workspace_billing/base/BaseWorkspaceBillings.class.php(148): BaseWorkspaceBillings->findOne(Array)
#7 /home/goo/public_html/application/models/projects/Project.class.php(455): BaseWorkspaceBillings->findOne(Array)
#8 /home/goo/public_html/application/controllers/TimeslotController.class.php(108): Project->getBillingAmount(0)
#9 /home/goo/public_html/environment/classes/controller/Controller.class.php(75): TimeslotController->add_timespan()
#10 /home/goo/public_html/environment/classes/controller/PageController.class.php(62): Controller->execute('add_timespan')
#11 /home/goo/public_html/environment/classes/Env.class.php(133): PageController->execute('add_timespan')
#12 /home/goo/public_html/init.php(146): Env::executeAction('timeslot', 'add_timespan')
#13 /home/goo/public_html/index.php(9): require('/home/goo/publi...')
#14 {main}
Autoglobal varibles:
$_GET:    Array (
  ['active_project'] => (string) '28'
  ['ajax'] => (string) 'true'
  ['c'] => (string) 'timeslot'
  ['a'] => (string) 'add_timespan'
  ['object_id'] => (string) '385'
  ['object_manager'] => (string) 'ProjectTasks'
  ['current'] => (string) 'tasks-panel'
)
$_POST:    Array (
  ['timeslot'] => Array (
    ['description'] => (string) 'asdf'
    ['time'] => (string) '.5'
  )
)
$_COOKIE:    Array (
  ['PHPSESSID'] => (string) '2ac4b691573fd0551cb715f727a97856'
  ['id'] => (string) '1'
  ['token'] => (string) 'ba09f24cc485bfec2248fafeb9097df39db443c8'
)
$_SESSION:    Array (
  ['cal_version'] => true
  ['month'] => (string) '3'
  ['year'] => (string) '2009'
  ['day'] => (string) '18'
  ['total_task_times_report_data'] => Array (
    ['date_type'] => (string) '4'
    ['timeslot_type'] => (string) '0'
    ['start_value'] => (string) '03/18/2009'
    ['end_value'] => (string) '03/18/2009'
    ['user'] => (string) '0'
    ['project_id'] => (string) '6'
    ['include_subworkspaces'] => (string) 'checked'
    ['group_by_1'] => (string) '0'
    ['group_by_2'] => (string) '0'
    ['group_by_3'] => (string) '0'
    ['alt_group_by_1'] => (string) '0'
    ['alt_group_by_2'] => (string) '0'
    ['alt_group_by_3'] => (string) '0'
  )
)

jtgrassie

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: error adding Time
« Reply #2 on: March 20, 2009, 02:51:04 pm »
I am getting this in my error log...

[Fri Mar 20 17:46:58 2009] [error] PHP Fatal error:  Uncaught exception 'InvalidParamError' with message 'There is no session matching this name (null for default session): NULL' in /var/www/htdocs/opengoo/environment/classes/logger/Logger.class.php:83\nStack trace:\n#0 /var/www/htdocs/opengoo/init.php(153): Logger::log(Object(DBQueryError), 4)\n#1 /var/www/htdocs/opengoo/index.php(9): require('/var/www/htdocs...')\n#2 {main}\n  thrown in /var/www/htdocs/opengoo/environment/classes/logger/Logger.class.php on line 83

kikobono

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: error adding Time
« Reply #3 on: March 21, 2009, 05:52:57 am »
Any idea?
I have tons of time sheets to input! :)

jtgrassie

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: error adding Time
« Reply #4 on: March 21, 2009, 05:58:23 am »
I found a quick and dirty solution.

Someone had what sounds like the same bug in the rc2 and someone posted a 'fix':
http://forums.opengoo.org/index.php?topic=1172.msg4624#msg4624

This didnt work for me but by simply returning 0 from that function instead sorted for me.
Note this is only of use if you dont care about the billing (which we dont use - yet).

kikobono

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: error adding Time
« Reply #5 on: March 21, 2009, 06:19:54 am »
Hi guys.
That line of code is already in that file... So, this solution doesn't fix the problem. :-(

But putting a new line that makes the function returnina a 0 worked.

So, the code now is:

Code: [Select]
function getBillingAmount($billing_category_id){
return 0;

if (!is_numeric($billing_category_id)) $billing_category_id = 0;
...

Thanks to jtgrassie.

Enrico