Created
February 11, 2019 19:12
-
-
Save arysom/88b6dc78c7a902cea5208e7c7cd181a1 to your computer and use it in GitHub Desktop.
drupal update hook example
This file contains hidden or 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
| <?php | |
| function arkowy_update_7001() { | |
| module_enable(['workbench_feature'], true); | |
| } | |
| function arkowy_update_7002() { | |
| module_enable(['workbench_feature'], true); | |
| } | |
| function arkowy_update_7003() { | |
| $user_fields = user_load_by_name('hania'); | |
| $user_fields->status = 1; | |
| user_save($user_fields); | |
| } | |
| function arkowy_update_7004() { | |
| $new_role = user_role_load_by_name('Manager'); | |
| $user_fields = user_load_by_name('hania'); | |
| $user_fields->roles[$new_role->rid] = $new_role->name; | |
| user_save($user_fields); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment