Skip to content

Commit

Permalink
Fixes for site install
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Bäse committed Dec 24, 2024
1 parent c31e426 commit 3c83911
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
19 changes: 0 additions & 19 deletions web/modules/custom/academy/questionnaire/questionnaire.install
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,10 @@ use Drupal\Core\Entity\EntityStorageException;
use Drupal\Core\Utility\Error;
use Drupal\paragraphs\Entity\ParagraphType;

/**
* Implements hook_install().
*/
function questionnaire_install(): void {
// Add questionnaire target bundle to paragraph reference in lecture entity.
$config = \Drupal::configFactory()->getEditable('field.field.lecture.lecture.paragraphs');
$current_types = $config->get('settings.handler_settings.target_bundles');
$current_types['questionnaire'] = 'questionnaire';
$config->set('settings.handler_settings.target_bundles', $current_types);
$config->save(TRUE);
}

/**
* Implements hook_uninstall().
*/
function questionnaire_uninstall(): void {
// Remove questionnaire target bundle to paragraph reference in lecture
// entity.
$config = \Drupal::configFactory()->getEditable('field.field.lecture.lecture.paragraphs');
$current_types = $config->get('settings.handler_settings.target_bundles');
unset($current_types['questionnaire']);
$config->set('settings.handler_settings.target_bundles', $current_types);
$config->save(TRUE);

// Remove config entity for questionnaire paragraph type.
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package: Projects
core_version_requirement: '^10.3 || ^11'

dependencies:
- creatives_dummy:creatives_dummy
- drupal:file
- drupal:user
- organizations_dummy:organizations_dummy
Expand Down

0 comments on commit 3c83911

Please sign in to comment.