Skip to content

Commit

Permalink
Issue #321: Done in PR #322
Browse files Browse the repository at this point in the history
  • Loading branch information
lexhouk authored Sep 9, 2024
2 parents eb9b90a + bd1d7af commit 876a263
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 18 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"cweagans/composer-patches": "^1.0",
"drupal/admin_toolbar": "3.4.1",
"drupal/autoban": "1.10",
"drupal/bootstrap": "3.29",
"drupal/bootstrap": "3.32",
"drupal/captcha": "2.0.6",
"drupal/config_update": "2.0.0-alpha4",
"drupal/core": "10.2.3",
Expand Down
2 changes: 1 addition & 1 deletion d8.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: The installation profile for CMS Drupal 10 based on the most common

type: profile
core_version_requirement: ^10.2
version: 0.19.4.181
version: 0.19.5.182

distribution:
name: D8+
Expand Down
16 changes: 16 additions & 0 deletions modules/features/d8_theming/d8_theming.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

/**
* @file
* Install, update and uninstall functions for the d8_theming module.
*/

use Drupal\d8\D8Setup;

/**
* Install jQuery UI Draggable and jQuery UI Resizable modules.
*/
function d8_theming_update_10201(array &$sandbox): void {
\Drupal::classResolver(D8Setup::class)
->module(['jquery_ui_draggable', 'jquery_ui_resizable']);
}
32 changes: 19 additions & 13 deletions src/D8Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,26 +147,32 @@ private function access(array &$sandbox): void {
}

/**
* (Un)install a module with optional checking of some other module.
* (Un)install modules with optional checking of some other module.
*
* @param string $target
* The name of the module from this installation profile or drupal.org.
* @param string|null $source
* (optional) The name of the module from drupal.org. If this parameter is
* specified then before installing/uninstalling the target module will be
* checked if the source module exists. Defaults to NULL.
* @param array|string $target
* The names of modules from this installation profile or drupal.org.
* @param array|string|null $source
* (optional) The names of modules from drupal.org. If this parameter is
* specified then before installing/uninstalling target modules, it will be
* checked if the source modules exist. Defaults to NULL.
* @param bool $uninstall
* (optional) TRUE, if the module should be installed. Defaults to FALSE.
* (optional) TRUE, if modules should be installed. Defaults to FALSE.
*/
public function module(
string $target,
string $source = NULL,
array|string $target,
array|string $source = NULL,
bool $uninstall = FALSE
): void {
if ($source === NULL || $this->moduleList()->exists($source)) {
$method = ($uninstall ? 'un' : '') . 'install';
$this->moduleInstaller()->$method([$target], !$uninstall);
if ($source !== NULL) {
foreach ((array) $source as $name) {
if (!$this->moduleList()->exists($name)) {
return;
}
}
}

$method = ($uninstall ? 'un' : '') . 'install';
$this->moduleInstaller()->$method((array) $target, !$uninstall);
}

}
14 changes: 11 additions & 3 deletions themes/custom/d8_theme/config/install/d8_theme.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ langcode: en
favicon:
mimetype: image/vnd.microsoft.icon
path: ''
url: /themes/contrib/bootstrap/favicon.ico
url: /profiles/contrib/d8/themes/custom/d8_theme/favicon.ico
use_default: true
features:
comment_user_picture: true
Expand All @@ -14,10 +14,18 @@ logo:
url: ''
use_default: true
schemas:
d8_theme: 8001
bootstrap: 8000
d8_theme: 8000
fluid_container: 1
image_shape: img-thumbnail
table_responsive: '0'
table: ''
navbar_position: static-top
table_responsive: 0
tooltip_placement: 'auto top'
cdn_theme: bootstrap
cdn_cache_ttl_versions: '604800'
cdn_cache_ttl_themes: '604800'
cdn_cache_ttl_assets: '0'
cdn_cache_ttl_library: '0'
apply: Apply
reset_http_request_cache: ''

0 comments on commit 876a263

Please sign in to comment.