public function OgUiMigrateAddField::import in Organic groups 7.2
Add OG_DEFAULT_ACCESS_FIELD to group.
File
- og_ui/
includes/ migrate/ 7000/ add_field.inc, line 31 - Add OG UI related fields to group node-types.
Class
- OgUiMigrateAddField
- @file Add OG UI related fields to group node-types.
Code
public function import() {
$bundles = og_get_all_group_bundle();
if (!empty($bundles['node'])) {
foreach (array_keys($bundles['node']) as $bundle) {
// Add the "Group roles and permissions" field to the bundle.
og_create_field(OG_DEFAULT_ACCESS_FIELD, 'node', $bundle);
}
}
// Delete the field that indicates we still need to add fields.
variable_del('og_ui_7000_add_field');
return MigrationBase::RESULT_COMPLETED;
}