Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACMS-000: Make media independent, remove common dependency. #1891

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/acquia_cms_audio/acquia_cms_audio.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ description: "Provides an Audio media type and related configuration."
type: module
core_version_requirement: ^9.4 || ^10 || ^11
dependencies:
- acquia_cms_common:acquia_cms_common
- drupal:media
- drupal:media_library
- drupal:taxonomy
- media_entity_soundcloud:media_entity_soundcloud
- field_group:field_group
11 changes: 10 additions & 1 deletion modules/acquia_cms_audio/acquia_cms_audio.install
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,20 @@
* Install, update and uninstall functions for the acquia_cms_audio module.
*/

use Drupal\Core\Config\FileStorage;
use Drupal\Core\Config\InstallStorage;
use Drupal\Core\Config\StorageInterface;

/**
* Implements hook_install().
*/
function acquia_cms_audio_install($is_syncing) {
if (!$is_syncing) {
_acquia_cms_common_editor_config_rewrite();
$optional_install_path = \Drupal::service('extension.path.resolver')->getPath('module', 'acquia_cms_audio') . '/' . InstallStorage::CONFIG_OPTIONAL_DIRECTORY;
if (is_dir($optional_install_path)) {
$config_installer = \Drupal::service('config.installer');
$storage = new FileStorage($optional_install_path, StorageInterface::DEFAULT_COLLECTION);
$config_installer->installOptionalConfig($storage, ['module' => 'acquia_cms_audio']);
}
}
}
4 changes: 3 additions & 1 deletion modules/acquia_cms_audio/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
"license": "GPL-2.0-or-later",
"type": "drupal-module",
"require": {
"drupal/acquia_cms_common": "^1.9 || ^2.1 || ^3.1",
"drupal/media_entity_soundcloud": "^3.1"
},
"require-dev": {
"drupal/acquia_cms_common": "^1.9 || ^2.1 || ^3.1"
},
"repositories": {
"assets": {
"type": "composer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ langcode: en
status: true
dependencies:
config:
- field.field.media.audio.field_categories
- field.field.media.audio.field_media_soundcloud
- field.field.media.audio.field_tags
- media.type.audio
module:
- field_group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ status: true
dependencies:
config:
- core.entity_form_mode.media.media_library
- field.field.media.audio.field_categories
- field.field.media.audio.field_media_soundcloud
- field.field.media.audio.field_tags
- media.type.audio
module:
- field_group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ langcode: en
status: true
dependencies:
config:
- field.field.media.audio.field_categories
- field.field.media.audio.field_media_soundcloud
- field.field.media.audio.field_tags
- media.type.audio
module:
- media_entity_soundcloud
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ status: true
dependencies:
config:
- core.entity_view_mode.media.embedded
- field.field.media.audio.field_categories
- field.field.media.audio.field_media_soundcloud
- field.field.media.audio.field_tags
- media.type.audio
module:
- media_entity_soundcloud
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ status: false
dependencies:
config:
- core.entity_view_mode.media.media_library
- field.field.media.audio.field_categories
- field.field.media.audio.field_media_soundcloud
- field.field.media.audio.field_tags
- image.style.medium
- media.type.audio
module:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
langcode: en
status: true
dependencies:
module:
- media
- taxonomy
id: media.field_categories
field_name: field_categories
entity_type: media
type: entity_reference
settings:
target_type: taxonomy_term
module: core
locked: false
cardinality: -1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
langcode: en
status: true
dependencies: { }
name: Tags
vid: tags
description: 'Descriptive metadata, for categorizing content and making search engines happy.'
weight: 0
5 changes: 4 additions & 1 deletion modules/acquia_cms_audio/tests/src/Functional/AudioTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ class AudioTest extends MediaTypeTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = ['acquia_cms_audio'];
protected static $modules = [
'acquia_cms_audio',
'acquia_cms_common'
];

/**
* Disable strict config schema checks in this test.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Ckeditor5ConfigurationTest extends Ckeditor5ConfigurationTestBase {
*/
protected static $modules = [
'acquia_cms_audio',
'acquia_cms_common',
];

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
langcode: en
status: true
dependencies: { }
name: Categories
vid: categories
description: 'Descriptive metadata, for categorizing content and making search engines happy.'
weight: 0
3 changes: 2 additions & 1 deletion modules/acquia_cms_document/acquia_cms_document.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ description: "Provides a Document media type and related configuration."
type: module
core_version_requirement: ^9.4 || ^10 || ^11
dependencies:
- drupal:file
- drupal:media
- drupal:media_library
- acquia_cms_common:acquia_cms_common
- drupal:taxonomy
- field_group:field_group
11 changes: 10 additions & 1 deletion modules/acquia_cms_document/acquia_cms_document.install
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,20 @@
* Install, update and uninstall functions for the acquia_cms_document module.
*/

use Drupal\Core\Config\FileStorage;
use Drupal\Core\Config\InstallStorage;
use Drupal\Core\Config\StorageInterface;

/**
* Implements hook_install().
*/
function acquia_cms_document_install($is_syncing) {
if (!$is_syncing) {
_acquia_cms_common_editor_config_rewrite();
$optional_install_path = \Drupal::service('extension.path.resolver')->getPath('module', 'acquia_cms_document') . '/' . InstallStorage::CONFIG_OPTIONAL_DIRECTORY;
if (is_dir($optional_install_path)) {
$config_installer = \Drupal::service('config.installer');
$storage = new FileStorage($optional_install_path, StorageInterface::DEFAULT_COLLECTION);
$config_installer->installOptionalConfig($storage, ['module' => 'acquia_cms_document']);
}
}
}
2 changes: 1 addition & 1 deletion modules/acquia_cms_document/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Provides a Document media type and related configuration.",
"license": "GPL-2.0-or-later",
"type": "drupal-module",
"require": {
"require-dev": {
"drupal/acquia_cms_common": "^1.9 || ^2.1 || ^3.1"
},
"repositories": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ langcode: en
status: true
dependencies:
config:
- field.field.media.document.field_categories
- field.field.media.document.field_media_file
- field.field.media.document.field_tags
- media.type.document
module:
- field_group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ status: true
dependencies:
config:
- core.entity_form_mode.media.media_library
- field.field.media.document.field_categories
- field.field.media.document.field_media_file
- field.field.media.document.field_tags
- media.type.document
module:
- field_group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ langcode: en
status: true
dependencies:
config:
- field.field.media.document.field_categories
- field.field.media.document.field_media_file
- field.field.media.document.field_tags
- image.style.card
- media.type.document
module:
- image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ status: true
dependencies:
config:
- core.entity_view_mode.media.embedded
- field.field.media.document.field_categories
- field.field.media.document.field_media_file
- field.field.media.document.field_tags
- media.type.document
module:
- file
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
langcode: en
status: true
dependencies:
module:
- media
- taxonomy
id: media.field_categories
field_name: field_categories
entity_type: media
type: entity_reference
settings:
target_type: taxonomy_term
module: core
locked: false
cardinality: -1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
langcode: en
status: true
dependencies:
module:
- media
- taxonomy
id: media.field_tags
field_name: field_tags
entity_type: media
type: entity_reference
settings:
target_type: taxonomy_term
module: core
locked: false
cardinality: -1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
langcode: en
status: true
dependencies: { }
name: Categories
vid: categories
description: 'Descriptive metadata, for categorizing content and making search engines happy.'
weight: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
langcode: en
status: true
dependencies: { }
name: Tags
vid: tags
description: 'Descriptive metadata, for categorizing content and making search engines happy.'
weight: 0
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class DocumentPermissionsTest extends MediaPermissionsTestBase {
*/
protected static $modules = [
'acquia_cms_document',
'acquia_cms_common',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ class DocumentTest extends MediaTypeTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = ['acquia_cms_document'];
protected static $modules = [
'acquia_cms_document',
'acquia_cms_common',
];

/**
* Disable strict config schema checks in this test.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Ckeditor5ConfigurationTest extends Ckeditor5ConfigurationTestBase {
*/
protected static $modules = [
'acquia_cms_document',
'acquia_cms_common',
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ class DocumentEmbedTest extends MediaEmbedTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = ['acquia_cms_document'];
protected static $modules = [
'acquia_cms_document',
'acquia_cms_common',
];

/**
* Disable strict config schema checks in this test.
Expand Down
5 changes: 3 additions & 2 deletions modules/acquia_cms_image/acquia_cms_image.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ description: "Provides an Image media type and related configuration."
type: module
core_version_requirement: ^9.4 || ^10 || ^11
dependencies:
- acquia_cms_common:acquia_cms_common
- drupal:file
- drupal:image
- drupal:media
- drupal:media_library
- drupal:taxonomy
- imce:imce
- drupal:image
- field_group:field_group
- focal_point:focal_point
10 changes: 9 additions & 1 deletion modules/acquia_cms_image/acquia_cms_image.install
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*/

use Drupal\acquia_cms_image\SiteLogo;
use Drupal\Core\Config\FileStorage;
use Drupal\Core\Config\InstallStorage;
use Drupal\Core\Config\StorageInterface;
use Drupal\Core\Installer\InstallerKernel;
use Drupal\image\Entity\ImageStyle;

Expand All @@ -14,7 +17,12 @@ use Drupal\image\Entity\ImageStyle;
*/
function acquia_cms_image_install($is_syncing) {
if (!$is_syncing) {
_acquia_cms_common_editor_config_rewrite(TRUE);
$optional_install_path = \Drupal::service('extension.path.resolver')->getPath('module', 'acquia_cms_image') . '/' . InstallStorage::CONFIG_OPTIONAL_DIRECTORY;
if (is_dir($optional_install_path)) {
$config_installer = \Drupal::service('config.installer');
$storage = new FileStorage($optional_install_path, StorageInterface::DEFAULT_COLLECTION);
$config_installer->installOptionalConfig($storage, ['module' => 'acquia_cms_image']);
}
\Drupal::classResolver(SiteLogo::class)->createLogo()->setLogo();
}
}
Expand Down
4 changes: 3 additions & 1 deletion modules/acquia_cms_image/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
"license": "GPL-2.0-or-later",
"type": "drupal-module",
"require": {
"drupal/acquia_cms_common": "^1.9 || ^2.1 || ^3.1",
"drupal/focal_point": "^2.1",
"drupal/imagemagick": "^3.4 || ^4.0",
"drupal/imce": "^2.2 || ^3.0"
},
"require-dev": {
"drupal/acquia_cms_common": "^1.9 || ^2.1 || ^3.1"
},
"repositories": {
"assets": {
"type": "composer",
Expand Down
Loading
Loading