Skip to content

Instantly share code, notes, and snippets.

@googletorp
Last active December 17, 2015 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save googletorp/5676202 to your computer and use it in GitHub Desktop.
Save googletorp/5676202 to your computer and use it in GitHub Desktop.
A fix for installing registration module on aegir
diff --git a/registration.install b/registration.install
index 5746828..c2e084b 100644
--- a/registration.install
+++ b/registration.install
@@ -372,6 +372,14 @@ function registration_field_schema($field) {
* Implements hook_install().
*/
function registration_install() {
+ // Some weird bug wuth classes not being loaded properly.
+ module_load_include('inc', 'registration', 'lib/registration_state.controller');
+ module_load_include('inc', 'registration', 'lib/registration_state.entity');
+ module_load_include('inc', 'registration', 'lib/registration_state.ui_controller');
+ module_load_include('inc', 'registration', 'lib/registration_type.entity');
+ module_load_include('inc', 'registration', 'lib/registration_type.ui_controller');
+ module_load_include('inc', 'registration', 'lib/registration.entity');
+ module_load_include('inc', 'registration', 'lib/registration.metadata');
// Create default states.
$states = array(
'complete' => array(
@@ -412,7 +420,12 @@ function registration_install() {
'weight' => $state_label['weight'],
)
);
- $registration_state->save();
+ if (method_exists($registration_state, 'save')) {
+ $registration_state->save();
+ }
+ else {
+ entity_save('registration_state', $registration_state);
+ }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment