Skip to content

Commit

Permalink
Fix Give department managers 'manager-role' to the departments children
Browse files Browse the repository at this point in the history
  • Loading branch information
Juulia Devadze committed Feb 6, 2018
1 parent 49a6ef3 commit 3b94ce6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions includes/og_roles.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Give department managers 'manager-role' to the departments children
*/
function os2intra_user_import_add_managers_to_departments($form, &$form_state) {
if (is_object($form['#term'])) {
$department = entity_metadata_wrapper('taxonomy_term', $form['#term']->tid);
if (is_array($form['#term'])) {
$department = entity_metadata_wrapper('taxonomy_term', $form['#term']['tid']);

// Get department children
$department_children = taxonomy_get_tree(16, $department->tid->value());
Expand Down
2 changes: 1 addition & 1 deletion os2intra_user_import.module
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function os2intra_user_import_form_alter(&$form, &$form_state, $form_id) {
// Use os2intra_user_import_add_managers_to_departments() for submits
if ($form_id == 'taxonomy_form_term') {
if (variable_get('os2intra_add_managers_to_departments')) {
if (is_object($form['#term']) && $form['#term']->vid == variable_get('os2intra_groups_vocabulary_vid')) {
if (is_array($form['#term']) && $form['#term']['vid'] == variable_get('os2intra_groups_vocabulary_vid')) {
$form['#submit'][] = "os2intra_user_import_add_managers_to_departments";
}
}
Expand Down

0 comments on commit 3b94ce6

Please sign in to comment.