Skip to content
Snippets Groups Projects
Commit 4935893b authored by Stephen Mustgrave's avatar Stephen Mustgrave
Browse files

Issue #3386484 by timohuisman: Skip config update when quiz_result_feedback...

Issue #3386484 by timohuisman: Skip config update when quiz_result_feedback paragraph bundle is not installed
parent efc192bf
No related branches found
No related tags found
No related merge requests found
......@@ -15,14 +15,14 @@ use Drupal\Core\StringTranslation\TranslatableMarkup;
* Grant default permissions to authenticated users, to take available quizzes
* and view their own results.
*/
function quiz_install() {
function quiz_install(): void {
user_role_grant_permissions(AccountInterface::AUTHENTICATED_ROLE, ['view own quiz_result', 'view any quiz', 'access quiz']);
}
/**
* Add owner field to quiz questions.
*/
function quiz_update_9001() {
function quiz_update_9001(): void {
$field_storage_definition = BaseFieldDefinition::create('entity_reference')
->setLabel(new TranslatableMarkup('User ID'))
->setSetting('target_type', 'user')
......@@ -35,7 +35,11 @@ function quiz_update_9001() {
/**
* Update configs from disk.
*/
function quiz_update_9002() {
function quiz_update_9002(): void {
$bundle_info = Drupal::service('entity_type.bundle.info')->getBundleInfo('paragraph');
if (empty($bundle_info['quiz_result_feedback'])) {
return;
}
$name = 'field.field.paragraph.quiz_result_feedback.quiz_feedback_range';
$source = new FileStorage(__DIR__ . '/config/install');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment