sproctor / php-calendar

PHP-Calendar
http://www.php-calendar.org/
Apache License 2.0
140 stars 67 forks source link

Error after upgrading from 2.0_beta8 to 2.0.10 #154

Closed nathanzachary closed 6 years ago

nathanzachary commented 6 years ago

After upgrading from 2.0_beta8 to 2.0.10, I get the following error when attempting to connect to my calendar:

Error
Error in get_occurrences_by_date_range

Unknown column 'time_type' in 'field list'
SQL query: SELECT `caldb_categories`.`gid`, `caldb_events`.`subject`, `caldb_events`.`description`, `caldb_events`.`owner`, `caldb_events`.`eid`, `caldb_events`.`cid`, `caldb_events`.`readonly`, `caldb_events`.`catid`, UNIX_TIMESTAMP(`ctime`) AS `ctime`, UNIX_TIMESTAMP(`mtime`) AS `mtime`, `time_type`, `oid`, UNIX_TIMESTAMP(`start_ts`) AS `start_ts`, DATE_FORMAT(`start_date`, '%Y%m%d') AS `start_date`, UNIX_TIMESTAMP(`end_ts`) AS `end_ts`, DATE_FORMAT(`end_date`, '%Y%m%d') AS `end_date`
, `username`, `name`, `bg_color`, `text_color`
FROM `caldb_events`
INNER JOIN `caldb_occurrences` USING (`eid`)
LEFT JOIN `caldb_users` ON `uid` = `owner`
LEFT JOIN `caldb_categories` ON `caldb_events`.`catid` = `caldb_categories`.`catid`
WHERE `caldb_events`.`cid` = '1'
    AND IF(`start_ts`, `start_ts` <= FROM_UNIXTIME('1512277199'), `start_date` <= DATE(FROM_UNIXTIME('1512277199')))
    AND IF(`end_ts`, `end_ts` >= FROM_UNIXTIME('1509249600'), `end_date` >= DATE(FROM_UNIXTIME('1509249600')))
    ORDER BY `start_ts`, `start_date`, `oid`
Backtrace
#0 /var/www/domains/DOMAIN/cal/htdocs/includes/phpcdatabase.class.php(123): PhpcDatabase->db_error('Error in get_oc...', 'SELECT `nzachar...')
#1 /var/www/domains/DOMAIN/cal/htdocs/includes/display_month.php(98): PhpcDatabase->get_occurrences_by_date_range(1, 1509249600, 1512277199)
#2 /var/www/domains/DOMAIN/cal/htdocs/includes/display_month.php(74): create_month('11', '2017')
#3 [internal function]: display_month()
#4 /var/www/domains/DOMAIN/cal/htdocs/includes/calendar.php(835): call_user_func('display_month')
#5 /var/www/domains/DOMAIN/cal/htdocs/includes/calendar.php(777): do_action()
#6 /var/www/domains/DOMAIN/cal/htdocs/index.php(86): display_phpc()
#7 {main}
sproctor commented 6 years ago

Did you run the updater? Did it give you any errors? I did see a minor issue with the updater for 2.0-beta9 and before, but I don't think it would've caused any problems.

nathanzachary commented 6 years ago

Hello Sean,

Yes, I ran the updater, and it didn't throw any errors at all. It actually said that the upgrade was successful. However, then when I visit the calendar, that's all that's there. If you need information about the web stack, here it is:

Apache 2.4.29 PHP 5.6.32 (via PHP-FPM) MariaDB 10.2.10

If there's any other information that I can provide, please let me know. I'm going to back out the changes now so at least I have a calendar. :)

Cheers, Nathan Zachary

sproctor commented 6 years ago

I reproduced this. I made one change that I didn't think would fix it, but it's working for me now. It's either setup dependent, or my change worked. Sorry for taking so long to get back to you and not looking into it in more depth. I pushed out 2.0.11 with these changes.