Closed stephen-cox closed 2 years ago
Hi Steve, Thanks for this change. I have test it and may have spotted two issues:
drush php-eval Drupal::keyValue("system.schema")->set("localgov_workflows", 9000)'
) and followed by a drush --yes updatedb
and this time the Contributor role showed up.So this change clearly works on a site where localgov_workflows is already installed but perhaps not on sites which never installed localgov_workflows. This may be a nonissue given that every LocalGov site probably already have the localgov_workflows module installed, right?
After doing drush updatedb
, I exported the config and noticed that the exported user.role.localgov_contributor.yml file is missing the UUID property. This may be an issue given that other role config files do have a UUID (and also the _core) property :(
Thanks for taking a look @Adnan-cds
I should have fixed both issue.
Thanks @Adnan-cds for the pointer the where we're doing this already. I realised it's better to use create the user role with
\Drupal::entityTypeManager()->getStorage('user_role')
->create($contributor_config)
->save();
as this adds the UUID without needing to do it manually.
Thanks Steve. Feel free to merge.
Added update hook to install contributor role if it doesn't already exists
Closes #5