Author Topic: [SOLVED IN 1.6-Stable][1.6-rc] calendar module - query failed  (Read 1747 times)

Nuno Zimas

  • Full Member
  • ***
  • Posts: 127
    • View Profile
[SOLVED IN 1.6-Stable][1.6-rc] calendar module - query failed
« on: December 02, 2009, 11:53:43 am »
Quote
Error (DBQueryError)
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 ' 'development', 'extension', 'joomla', 'meeting', 'sitemap' AND `og_project_eve' at line 94'
Error params:
File:    /path/to/opengoo/environment/library/database/adapters/AbstractDBAdapter.class.php
Line:    386
Sql:    SELECT * FROM `og_project_events` WHERE `trashed_by_id` = 0 AND ( ( -- -- THIS RETURNS EVENTS ON THE ACTUAL DAY IT'S SET FOR (ONE TIME EVENTS) -- ( `repeat_h` = 0 AND ( `duration` > `start` AND (`start` >= '2009-12-01 23:00:00' AND `start` < '2009-12-02 23:00:00' OR `duration` <= '2009-12-02 23:00:00' AND `duration` > '2009-12-01 23:00:00' OR `start` < '2009-12-01 23:00:00' AND `duration` > '2009-12-02 23:00:00') OR `type_id` = 2 AND `start` >= '2009-12-01 23:00:00' AND `start` < '2009-12-02 23:00:00' ) ) -- -- THIS RETURNS REGULAR REPEATING EVENTS - DAILY, WEEKLY, MONTHLY, OR YEARLY. -- OR ( `repeat_h` = 0 AND DATE(`start`) <= '2009-12-01 23:00:00' AND ( ( MOD( DATEDIFF(ADDDATE(`start`, INTERVAL 1 HOUR), '2009-12-02') ,repeat_d) = 0 AND ( ADDDATE(DATE(`start`), INTERVAL ((repeat_num-1)*repeat_d) DAY) >= '2009-12-01 23:00:00' OR repeat_forever = 1 OR repeat_end >= '2009-12-02' ) ) OR ( MOD( PERIOD_DIFF(DATE_FORMAT(`start`,'%Y%m'),DATE_FORMAT('2009-12-01 23:00:00','%Y%m')) ,repeat_m) = 0 AND `start` <= '2009-12-01 23:00:00' AND DAY(`start`) = 02 AND ( ADDDATE(DATE(`start`), INTERVAL ((repeat_num-1)*repeat_m) MONTH) >= '2009-12-01 23:00:00' OR repeat_forever = 1 OR repeat_end >= '2009-12-02' ) ) OR ( MOD( (YEAR(DATE(`start`))-YEAR('2009-12-01 23:00:00')) ,repeat_y) = 0 AND `start` <= '2009-12-01 23:00:00' AND DAY(`start`) = 02 AND MONTH(`start`) = 12 AND ( ADDDATE(DATE(`start`), INTERVAL ((repeat_num-1)*repeat_y) YEAR) >= '2009-12-01 23:00:00' OR repeat_forever = 1 OR repeat_end >= '2009-12-02' ) ) ) ) -- -- THIS RETURNS EVENTS SET TO BE A CERTAIN DAY OF THE WEEK IN A CERTAIN WEEK EVERY CERTAIN AMOUNT OF MONTHS -- OR ( DATE(`start`) <= '2009-12-01 23:00:00' AND `repeat_h` = 1 AND `repeat_dow` = DAYOFWEEK('2009-12-01 23:00:00') AND `repeat_wnum` + 49 - 1 = WEEK('2009-12-01 23:00:00', 3) AND MOD( PERIOD_DIFF(DATE_FORMAT(`start`, '%Y%m'), DATE_FORMAT('2009-12-01 23:00:00', '%Y%m')), `repeat_mjump`) = 0 ) ) AND `id` IN (SELECT `object_id` FROM `og_workspace_objects` WHERE `object_manager` = 'ProjectEvents' AND `workspace_id` IN (SELECT `og_project_users`.`project_id` FROM `og_project_users`, `og_projects` 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 (`og_project_users`.`project_id` = `og_projects`.`id` AND `og_projects`.`completed_on` = '0000-00-00 00:00:00'))) AND ( ( ( `created_by_id` = 1) OR ( EXISTS(SELECT * FROM `og_users` `xx_u`, `og_workspace_objects` `xx_wo` WHERE `xx_u`.`id` = 1 AND `xx_u`.`personal_project_id` = `xx_wo`.`workspace_id` AND `xx_wo`.`object_id` = og_project_events.id AND `xx_wo`.`object_manager` = 'ProjectEvents' )) 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_events.id AND `xx_wo`.`object_manager` = 'ProjectEvents' AND `xx_pu`.can_read_events = true ) ) ) ) AND EXISTS (SELECT * FROM `og_tags` `t` WHERE `tag` = 'coordimation', 'development', 'extension', 'joomla', 'meeting', 'sitemap' AND `og_project_events`.`id` = `t`.`rel_object_id` AND `t`.`rel_object_manager` = 'ProjectEvents') AND `archived_by_id` = 0) ORDER BY `start`
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 ' 'development', 'extension', 'joomla', 'meeting', 'sitemap' AND `og_project_eve' at line 94
Backtrace:
#0 /path/to/opengoo/environment/library/database/adapters/AbstractDBAdapter.class.php(304): AbstractDBAdapter->prepareAndExecute('SELECT * FROM `...', NULL)
#1 /path/to/opengoo/environment/library/database/DB.class.php(211): AbstractDBAdapter->executeAll('SELECT * FROM `...', NULL)
#2 /path/to/opengoo/environment/classes/dataaccess/DataManager.class.php(262): DB::executeAll('SELECT * FROM `...')
#3 /path/to/opengoo/application/models/ProjectDataObjects.class.php(31): DataManager->find(Array)
#4 /path/to/opengoo/application/models/project_events/base/BaseProjectEvents.class.php(176): ProjectDataObjects->find(Array)
#5 /path/to/opengoo/environment/classes/dataaccess/DataManager.class.php(299): BaseProjectEvents->find(Array)
#6 /path/to/opengoo/application/models/project_events/base/BaseProjectEvents.class.php(193): DataManager->findAll(Array)
#7 /path/to/opengoo/application/models/project_events/base/BaseProjectEvents.class.php(195): BaseProjectEvents->findAll(Array)
#8 /path/to/opengoo/application/models/project_events/ProjectEvents.class.php(158): BaseProjectEvents::findAll(Array)
#9 /path/to/opengoo/application/views/event/calendar.php(297): ProjectEvents::getDayProjectEvents(Object(DateTimeValue), Array, NULL, '1', ' 0 1 3')
#10 /path/to/opengoo/environment/classes/template/Template.class.php(85): include('/var/www/opengo...')
#11 /path/to/opengoo/environment/classes/template/Template.class.php(56): Template->includeTemplate('/var/www/opengo...')
#12 /path/to/opengoo/environment/classes/template/template.php(35): Template->fetch('/var/www/opengo...')
#13 /path/to/opengoo/environment/classes/controller/PageController.class.php(115): tpl_fetch('/var/www/opengo...')
#14 /path/to/opengoo/environment/classes/Env.class.php(139): PageController->getContent()
#15 /path/to/opengoo/init.php(149): Env::executeAction('event', 'view_calendar')
#16 /path/to/opengoo/index.php(9): require('/var/www/opengo...')
#17 {main}
Autoglobal varibles:
$_GET:    Array (
  ['active_project'] => (string) '0'
  ['ajax'] => (string) 'true'
  ['c'] => (string) 'event'
  ['a'] => (string) 'view_calendar'
  ['current'] => (string) 'calendar-panel'
  ['_dc'] => (string) '1259765236762'
)
$_POST:    
$_COOKIE:    Array (
  ['id'] => (string) '1'
  ['token'] => (string) '247d24063ae5ee27021a59f4fae36a8ca3387d9a'
  ['remember'] => (string) '1'
  ['PHPSESSID'] => (string) '910ae980ba29a067ebb4e6c5346f4db8'
)
$_SESSION:    Array (
  ['year'] => (string) '2009'
  ['month'] => (string) '12'
  ['day'] => (string) '2'
)
« Last Edit: December 08, 2009, 11:53:38 pm by Nuno Zimas »
OS: GNU/Linux (PCLinuxOS) | Browser: Firefox 3.6.x and Chromium 5.0.x | FengOffice 1.7 RC

Coty

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: [1.6-rc] calendar module - query failed
« Reply #1 on: December 03, 2009, 05:49:20 pm »
I receive the same error message. I believe the error message (at least in my case) is related to the tags assigned to the event.

If I have an event that is tagged with somebody's username it will cause this error. If I remove all of the tags and save the event the error message goes away.

If I then go back and assign a series of arbitrary tags and update the event, there is still no problem, as long as none of the tags were also a user name registered in the system.

But, as soon as I introduce a tag that also happens to be a registered user name it will throw that error when attempting to view the calendar tab on the month that the event takes place.
 

Nuno Zimas

  • Full Member
  • ***
  • Posts: 127
    • View Profile
Re: [1.6-rc] calendar module - query failed
« Reply #2 on: December 03, 2009, 07:54:28 pm »
Extremely odd.
In our particular installation, we don't tag any object after a username.
I'm sure it is related to tagging, but i can't establish a pattern.
OS: GNU/Linux (PCLinuxOS) | Browser: Firefox 3.6.x and Chromium 5.0.x | FengOffice 1.7 RC

 

anything