diff --git a/uw_cfg_common.install b/uw_cfg_common.install index c5c52ba5b5d140c8f0eba37bc50e8d4917f44e37..a2b1beee53046875df309196ab88223b9e3725ed 100644 --- a/uw_cfg_common.install +++ b/uw_cfg_common.install @@ -708,3 +708,22 @@ function uw_cfg_common_update_9106(&$sandbox) { } } } + +/** + * Swap the order of content author and editor roles. + */ +function uw_cfg_common_update_9107(&$sandbox) { + // The original weight of content editor role is 5. + // The original weight of content author role is 4. + $role_ids = [ + 'uw_role_content_editor' => 4, + 'uw_role_content_author' => 5, + ]; + // Set new weight of content editor role as 4. + // Set new weight of content author role as 5. + foreach ($role_ids as $role_id => $weight) { + $role = Role::load($role_id); + $role->setWeight($weight); + $role->save(); + } +}