forked from CollaboraOnline/collabora-drupal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue CollaboraOnline#52: Override groupmedia view.
- Loading branch information
1 parent
b288e26
commit ab66195
Showing
3 changed files
with
1,039 additions
and
4 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
modules/collabora_online_group/collabora_online_group.install
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
use Drupal\Core\Config\FileStorage; | ||
|
||
/** | ||
* Implements hook_install(). | ||
*/ | ||
function collabora_online_group_install(): void { | ||
if ( | ||
\Drupal::moduleHandler()->moduleExists('views') && | ||
\Drupal::entityTypeManager()->getStorage('view')->load('group_media') | ||
) { | ||
// Update view with module configuration. | ||
$name = 'views.view.group_media'; | ||
$module_path = Drupal::moduleHandler()->getModule('collabora_online_group')->getPath(); | ||
$source = new FileStorage($module_path . '/config/override'); | ||
/** @var \Drupal\Core\Config\StorageInterface $active_storage */ | ||
$active_storage = \Drupal::service('config.storage'); | ||
$config = $source->read( $name); | ||
$active_storage->write($name, $config); | ||
} | ||
} |
Oops, something went wrong.