-
-
Save austinpray/3d9b716a7ce0da601639 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit e9bc6f9bca87d3eeb6de916b8072b1f5088a5fb5 | |
Author: Austin Pray <austin@austinpray.com> | |
Date: Wed Sep 2 17:57:59 2015 -0500 | |
Fixes a birchpress provider creation bug | |
Guess I'll just do their job for them. | |
diff --git a/web/app/plugins/birchschedule/modules/gcalsync/package.php b/web/app/plugins/birchschedule/modules/gcalsync/package.php | |
index e83e7d0..e1b7ae2 100644 | |
--- a/web/app/plugins/birchschedule/modules/gcalsync/package.php | |
+++ b/web/app/plugins/birchschedule/modules/gcalsync/package.php | |
@@ -366,12 +366,14 @@ birch_ns( 'birchschedule.gcalsync', function( $ns ) { | |
'_birs_staff_gcal_calendar_id', | |
) | |
) ); | |
- $staff['_birs_staff_gcal_calendar_id'] = $_POST['bir_staff_gcal_calendar_id']; | |
- $birchschedule->model->save( $staff, array( | |
- 'keys' => array( | |
- '_birs_staff_gcal_calendar_id' | |
- ) | |
- ) ); | |
+ if (array_key_exists('birs_staff_gcal_calendar_id', $staff)) { | |
+ $staff['_birs_staff_gcal_calendar_id'] = $_POST['bir_staff_gcal_calendar_id']; | |
+ $birchschedule->model->save( $staff, array( | |
+ 'keys' => array( | |
+ '_birs_staff_gcal_calendar_id' | |
+ ) | |
+ ) ); | |
+ } | |
}; | |
$ns->get_gcal_calendar_id = function( $staff_id ) use ( $ns, $birchschedule ) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment