wasimshaikh / php-calendar

Automatically exported from code.google.com/p/php-calendar
1 stars 0 forks source link

Error in get_occurrences_by_date_range #60

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Opening the calendar's index page (either logged in or logged out)
2.
3.

What is the expected output? What do you see instead?
-The calendar

-Calendar links and the following errors:
Error

Error in get_occurrences_by_date_range<br />Unknown column 
'jwin_wc.phpc_users.catid' in 'on clause'<br />SQL query: SELECT `subject`, 
`description`, `phpc_events`.`eid`, `phpc_events`.`cid`, `oid`, `owner`, 
`username`, `timetype`, `readonly`, `phpc_events`.`catid`, `name`, `bg_color`, 
`text_color`, HOUR(`starttime`) AS `starthour`, MINUTE(`starttime`) AS 
`startminute`, HOUR(`endtime`) AS `endhour`, MINUTE(`endtime`) AS `endminute`, 
YEAR(`startdate`) AS `startyear`, MONTH(`startdate`) AS `startmonth`, 
DAY(`startdate`) AS `startday`, YEAR(`enddate`) AS `endyear`, MONTH(`enddate`) 
AS `endmonth`, DAY(`enddate`) AS `endday` FROM `phpc_events` INNER JOIN 
`phpc_occurrences` USING (`eid`) LEFT JOIN `phpc_users` on `uid` = `owner` LEFT 
JOIN `phpc_categories` USING (`catid`) WHERE `phpc_events`.`cid` = '1' AND 
`startdate` <= DATE('2011-05-02') AND `enddate` >= DATE('2011-03-29') ORDER BY 
`startdate`, `starttime`, `oid`
Backtrace

#0 /home/jwin/public_html/calendar/includes/phpcdatabase.class.php(687): 
soft_error()
#1 /home/jwin/public_html/calendar/includes/phpcdatabase.class.php(80): 
PhpcDatabase->db_error('Error in get_oc...')
#2 /home/jwin/public_html/calendar/includes/display_month.php(121): 
PhpcDatabase->get_occurrences_by_date_range('Error in get_oc...', 'SELECT 
`subject...')
#3 /home/jwin/public_html/calendar/includes/display_month.php(61): 
create_month(1, 1301371200, 1304308800)
#4 /home/jwin/public_html/calendar/includes/calendar.php(624) : eval()'d 
code(1): display_month('4', '2011')
#5 /home/jwin/public_html/calendar/includes/calendar.php(624): eval()
#6 /home/jwin/public_html/calendar/includes/calendar.php(592): do_action()
#7 /home/jwin/public_html/calendar/index.php(75): display_phpc()
#8 {main}

What version of the product are you using? On what operating system?
Using 2.0 beta9 on a linux server w/ apache, PHP 5.2.14 & MySQL 4.1.22 Standard 
w/ mysqli

Please provide any additional information below.
I can log in and out as the admin w/o issue

Original issue reported on code.google.com by thebarl...@gmail.com on 4 Apr 2011 at 2:15

GoogleCodeExporter commented 9 years ago
same error here.  I also meet the requirements.

Original comment by jerrod.d...@gmail.com on 5 Apr 2011 at 1:28

GoogleCodeExporter commented 9 years ago
This is weird. It seems to be an issue with MySQL 4.1. Also, there's some 
weirdness with the backtrace there. The arguments are for the function for the 
previous line.

Anyway, can you try replacing the line 72 of phpcdatabase.class.php

<code>."LEFT JOIN `$cats_table` USING (`catid`)\n"</code>

with

<code>."LEFT JOIN `$cats_table` ON $cats_table.catid = 
$sql_events.catid\n"</code>

Original comment by sproctor@gmail.com on 7 Apr 2011 at 7:58

GoogleCodeExporter commented 9 years ago
Well, I wish I could tell you how that worked - my webhost just updated MySQL 
to 5.0.92-community and it is working like a charm!

Original comment by thebarl...@gmail.com on 8 Apr 2011 at 12:05

GoogleCodeExporter commented 9 years ago
Closing this issue unless someone can reproduce it still.

Original comment by sproctor@gmail.com on 3 May 2011 at 11:18