osseed / com.osseed.eventcalendar

CiviCRM Event Calendar
GNU General Public License v3.0
11 stars 37 forks source link

Add recurring_event and enrollment_status columns if missing #103

Closed brienneK closed 11 months ago

brienneK commented 1 year ago

Overview

Adding a new calendar may result in a DB error, caused by missing columns, depending on when the user's instance of this extension was upgraded.


Before

Depending on when this extension is installed, users may run into a fatal error when creating a calendar because the columns recurring_event and enrollment_status are missing from the database:

DebugInfo   INSERT INTO civicrm_event_calendar(calendar_title, show_past_events, show_end_date, show_public_events, events_by_month, event_timings, events_from_month, event_type_filters, week_begins_from_day, recurring_event, enrollment_status, saved_search_id) VALUES ('Tours', 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0); 
[nativecode=1054 ** Unknown column 
- DB_Error: DB Error: no such field in unknown on line unknown

These missing columns were addressed by PR #92, however, it didn't account for users who may have already run the upgrade_1001 step, in which case the fix would not be applied to their instance of the extension.


After

This PR adds a separate upgrade step to ensure that if the recurring_event and enrollment_status columns are missing, that they are added to the civicrm_event_calendar table.