Browse Source

Add module explicit dependencies.

wip
Alexander O'Neill 6 years ago
parent
commit
9e9b4fe592
  1. 38
      README.md
  2. 10
      composer.json
  3. 4
      config/optional/core.entity_form_display.paragraph.license_attribution.default.yml
  4. 4
      config/optional/core.entity_form_display.taxonomy_term.media_attribution_licenses.default.yml
  5. 4
      config/optional/core.entity_view_display.paragraph.license_attribution.default.yml
  6. 4
      config/optional/core.entity_view_display.taxonomy_term.media_attribution_licenses.default.yml
  7. 4
      config/optional/core.entity_view_mode.paragraph.license_attribution.yml
  8. 4
      config/optional/field.field.media.image.field_image_attribution.yml
  9. 4
      config/optional/field.field.paragraph.license_attribution.field_attribution_author.yml
  10. 4
      config/optional/field.field.paragraph.license_attribution.field_attribution_note.yml
  11. 4
      config/optional/field.field.paragraph.license_attribution.field_attribution_source.yml
  12. 5
      config/optional/field.field.paragraph.license_attribution.field_license.yml
  13. 4
      config/optional/field.field.taxonomy_term.media_attribution_licenses.field_license_icon.yml
  14. 4
      config/optional/field.field.taxonomy_term.media_attribution_licenses.field_license_link.yml
  15. 4
      config/optional/field.storage.media.field_image_attribution.yml
  16. 4
      config/optional/field.storage.paragraph.field_attribution_author.yml
  17. 4
      config/optional/field.storage.paragraph.field_attribution_note.yml
  18. 4
      config/optional/field.storage.paragraph.field_attribution_source.yml
  19. 4
      config/optional/field.storage.paragraph.field_license.yml
  20. 4
      config/optional/field.storage.taxonomy_term.field_license_icon.yml
  21. 4
      config/optional/field.storage.taxonomy_term.field_license_link.yml
  22. 8
      config/optional/paragraphs.paragraphs_type.license_attribution.yml
  23. 7
      config/optional/taxonomy.vocabulary.media_attribution_licenses.yml
  24. 2
      media_attribution.module

38
README.md

@ -1,5 +1,19 @@
# Installation # Installation
## Patch requirement
In order to properly use the license attribution form items with the inline media browser CKEditor button (the 'star' button), the following patch is required:
https://www.drupal.org/files/issues/paragraphs-missing-langcode-2901390-9.patch
From this Paragraphs issue: [Integrity constraint violation: 1048 Column 'langcode' cannot be null](https://www.drupal.org/project/paragraphs/issues/2901390)
Follow this link for instructions on adding patches to your project's composer.json file: [Apply Drupal 8 Patch by Composer without update Drupal Core](https://groups.drupal.org/node/518975).
## Enabling the module
Install as you normally would. This module creates the following entity types: Install as you normally would. This module creates the following entity types:
* Taxonomy vocabulary * Taxonomy vocabulary
@ -9,3 +23,27 @@ Install as you normally would. This module creates the following entity types:
# Use # Use
The installation script automatically adds teh attribution paragraphs field
to the Image media type if it exists. This is installed by default
by the Lightning distribution. Otherwise adding attribution
can be one at Admin -> Structure -> Media Types.
The attribution paragraph field has the following components
Source Work link, including a title and URL. This title is
usually the title of the original work.
Original Author link, including name and URL of the author's home page.
License type - optional, the license under which the linked work is released.
Free-form attribution text - optional, arbitrary text to clarify attribution. If no license is selected, this text can be used to identify copyrighted works with e.g.,
"All rights reserved, used with permisssion."
This source and author info will be rendered below an embedded media object when showing the node, following teh format
preferred by Creative Commons, outlined at [Best Practices for Attribution](https://wiki.creativecommons.org/wiki/best_practices_for_attribution).
# Licenses
Installing the module creates License taxonomy term entries for all of the use variations of the international Creative Commons
licenses. These can be edited, and other license types can be added as needed.

10
composer.json

@ -10,13 +10,5 @@
"issues": "https://www.drupal.org/project/issues/media_attribution", "issues": "https://www.drupal.org/project/issues/media_attribution",
"source": "http://cgit.drupalcode.org/media_attribution" "source": "http://cgit.drupalcode.org/media_attribution"
}, },
"require": { }, "require": { }
"extra": {
"enable-patching": true,
"patches": {
"drupal/paragraphs": {
"Integrity constraint violation: 1048 Column 'langcode' cannot be null": "https://www.drupal.org/files/issues/paragraphs-missing-langcode-2901390-9.patch"
}
}
}
} }

4
config/optional/core.entity_form_display.paragraph.license_attribution.default.yml

@ -11,6 +11,10 @@ dependencies:
module: module:
- link - link
- text - text
- media_attribution
enforced:
module:
- media_attribution
_core: _core:
default_config_hash: WCcyeF8AktyxDRFDYOVNNyfYpTfjnlsm53vdo1EP968 default_config_hash: WCcyeF8AktyxDRFDYOVNNyfYpTfjnlsm53vdo1EP968
id: paragraph.license_attribution.default id: paragraph.license_attribution.default

4
config/optional/core.entity_form_display.taxonomy_term.media_attribution_licenses.default.yml

@ -10,6 +10,10 @@ dependencies:
- entity_browser - entity_browser
- link - link
- text - text
- media_attribution
enforced:
module:
- media_attribution
_core: _core:
default_config_hash: GeroQ_nB3tqP5g0Z5B4UShGyIomjdHA8hDn73kSFYgc default_config_hash: GeroQ_nB3tqP5g0Z5B4UShGyIomjdHA8hDn73kSFYgc
id: taxonomy_term.media_attribution_licenses.default id: taxonomy_term.media_attribution_licenses.default

4
config/optional/core.entity_view_display.paragraph.license_attribution.default.yml

@ -8,6 +8,10 @@ dependencies:
- paragraphs.paragraphs_type.license_attribution - paragraphs.paragraphs_type.license_attribution
module: module:
- link - link
- media_attribution
enforced:
module:
- media_attribution
id: paragraph.license_attribution.default id: paragraph.license_attribution.default
targetEntityType: paragraph targetEntityType: paragraph
bundle: license_attribution bundle: license_attribution

4
config/optional/core.entity_view_display.taxonomy_term.media_attribution_licenses.default.yml

@ -9,6 +9,10 @@ dependencies:
- image - image
- link - link
- text - text
- media_attribution
enforced:
module:
- media_attribution
id: taxonomy_term.media_attribution_licenses.default id: taxonomy_term.media_attribution_licenses.default
targetEntityType: taxonomy_term targetEntityType: taxonomy_term
bundle: media_attribution_licenses bundle: media_attribution_licenses

4
config/optional/core.entity_view_mode.paragraph.license_attribution.yml

@ -3,6 +3,10 @@ status: true
dependencies: dependencies:
module: module:
- paragraphs - paragraphs
- media_attribution
enforced:
module:
- media_attribution
id: paragraph.license_attribution id: paragraph.license_attribution
label: 'License attribution' label: 'License attribution'
targetEntityType: paragraph targetEntityType: paragraph

4
config/optional/field.field.media.image.field_image_attribution.yml

@ -7,6 +7,10 @@ dependencies:
- paragraphs.paragraphs_type.license_attribution - paragraphs.paragraphs_type.license_attribution
module: module:
- entity_reference_revisions - entity_reference_revisions
- media_attribution
enforced:
module:
- media_attribution
id: media.image.field_image_attribution id: media.image.field_image_attribution
field_name: field_image_attribution field_name: field_image_attribution
entity_type: media entity_type: media

4
config/optional/field.field.paragraph.license_attribution.field_attribution_author.yml

@ -6,6 +6,10 @@ dependencies:
- paragraphs.paragraphs_type.license_attribution - paragraphs.paragraphs_type.license_attribution
module: module:
- link - link
- media_attribution
enforced:
module:
- media_attribution
id: paragraph.license_attribution.field_attribution_author id: paragraph.license_attribution.field_attribution_author
field_name: field_attribution_author field_name: field_attribution_author
entity_type: paragraph entity_type: paragraph

4
config/optional/field.field.paragraph.license_attribution.field_attribution_note.yml

@ -6,6 +6,10 @@ dependencies:
- paragraphs.paragraphs_type.license_attribution - paragraphs.paragraphs_type.license_attribution
module: module:
- text - text
- media_attribution
enforced:
module:
- media_attribution
third_party_settings: { } third_party_settings: { }
id: paragraph.license_attribution.field_attribution_note id: paragraph.license_attribution.field_attribution_note
field_name: field_attribution_note field_name: field_attribution_note

4
config/optional/field.field.paragraph.license_attribution.field_attribution_source.yml

@ -6,6 +6,10 @@ dependencies:
- paragraphs.paragraphs_type.license_attribution - paragraphs.paragraphs_type.license_attribution
module: module:
- link - link
- media_attribution
enforced:
module:
- media_attribution
id: paragraph.license_attribution.field_attribution_source id: paragraph.license_attribution.field_attribution_source
field_name: field_attribution_source field_name: field_attribution_source
entity_type: paragraph entity_type: paragraph

5
config/optional/field.field.paragraph.license_attribution.field_license.yml

@ -5,6 +5,11 @@ dependencies:
- field.storage.paragraph.field_license - field.storage.paragraph.field_license
- paragraphs.paragraphs_type.license_attribution - paragraphs.paragraphs_type.license_attribution
- taxonomy.vocabulary.media_attribution_licenses - taxonomy.vocabulary.media_attribution_licenses
module:
- media_attribution
enforced:
module:
- media_attribution
id: paragraph.license_attribution.field_license id: paragraph.license_attribution.field_license
field_name: field_license field_name: field_license
entity_type: paragraph entity_type: paragraph

4
config/optional/field.field.taxonomy_term.media_attribution_licenses.field_license_icon.yml

@ -6,6 +6,10 @@ dependencies:
- taxonomy.vocabulary.media_attribution_licenses - taxonomy.vocabulary.media_attribution_licenses
module: module:
- image - image
- media_attribution
enforced:
module:
- media_attribution
id: taxonomy_term.media_attribution_licenses.field_license_icon id: taxonomy_term.media_attribution_licenses.field_license_icon
field_name: field_license_icon field_name: field_license_icon
entity_type: taxonomy_term entity_type: taxonomy_term

4
config/optional/field.field.taxonomy_term.media_attribution_licenses.field_license_link.yml

@ -6,6 +6,10 @@ dependencies:
- taxonomy.vocabulary.media_attribution_licenses - taxonomy.vocabulary.media_attribution_licenses
module: module:
- link - link
- media_attribution
enforced:
module:
- media_attribution
id: taxonomy_term.media_attribution_licenses.field_license_link id: taxonomy_term.media_attribution_licenses.field_license_link
field_name: field_license_link field_name: field_license_link
entity_type: taxonomy_term entity_type: taxonomy_term

4
config/optional/field.storage.media.field_image_attribution.yml

@ -5,6 +5,10 @@ dependencies:
- entity_reference_revisions - entity_reference_revisions
- media - media
- paragraphs - paragraphs
- media_attribution
enforced:
module:
- media_attribution
id: media.field_image_attribution id: media.field_image_attribution
field_name: field_image_attribution field_name: field_image_attribution
entity_type: media entity_type: media

4
config/optional/field.storage.paragraph.field_attribution_author.yml

@ -4,6 +4,10 @@ dependencies:
module: module:
- link - link
- paragraphs - paragraphs
- media_attribution
enforced:
module:
- media_attribution
id: paragraph.field_attribution_author id: paragraph.field_attribution_author
field_name: field_attribution_author field_name: field_attribution_author
entity_type: paragraph entity_type: paragraph

4
config/optional/field.storage.paragraph.field_attribution_note.yml

@ -4,6 +4,10 @@ dependencies:
module: module:
- paragraphs - paragraphs
- text - text
- media_attribution
enforced:
module:
- media_attribution
third_party_settings: { } third_party_settings: { }
id: paragraph.field_attribution_note id: paragraph.field_attribution_note
field_name: field_attribution_note field_name: field_attribution_note

4
config/optional/field.storage.paragraph.field_attribution_source.yml

@ -4,6 +4,10 @@ dependencies:
module: module:
- link - link
- paragraphs - paragraphs
- media_attribution
enforced:
module:
- media_attribution
id: paragraph.field_attribution_source id: paragraph.field_attribution_source
field_name: field_attribution_source field_name: field_attribution_source
entity_type: paragraph entity_type: paragraph

4
config/optional/field.storage.paragraph.field_license.yml

@ -4,6 +4,10 @@ dependencies:
module: module:
- paragraphs - paragraphs
- taxonomy - taxonomy
- media_attribution
enforced:
module:
- media_attribution
id: paragraph.field_license id: paragraph.field_license
field_name: field_license field_name: field_license
entity_type: paragraph entity_type: paragraph

4
config/optional/field.storage.taxonomy_term.field_license_icon.yml

@ -5,6 +5,10 @@ dependencies:
- file - file
- image - image
- taxonomy - taxonomy
- media_attribution
enforced:
module:
- media_attribution
id: taxonomy_term.field_license_icon id: taxonomy_term.field_license_icon
field_name: field_license_icon field_name: field_license_icon
entity_type: taxonomy_term entity_type: taxonomy_term

4
config/optional/field.storage.taxonomy_term.field_license_link.yml

@ -4,6 +4,10 @@ dependencies:
module: module:
- link - link
- taxonomy - taxonomy
- media_attribution
enforced:
module:
- media_attribution
id: taxonomy_term.field_license_link id: taxonomy_term.field_license_link
field_name: field_license_link field_name: field_license_link
entity_type: taxonomy_term entity_type: taxonomy_term

8
config/optional/paragraphs.paragraphs_type.license_attribution.yml

@ -1,6 +1,12 @@
langcode: en langcode: en
status: true status: true
dependencies: { } dependencies:
module:
- media_attribution
enforced:
module:
- media_attribution
id: license_attribution id: license_attribution
label: 'License Attribution' label: 'License Attribution'
icon_uuid: null icon_uuid: null

7
config/optional/taxonomy.vocabulary.media_attribution_licenses.yml

@ -1,6 +1,11 @@
langcode: en langcode: en
status: true status: true
dependencies: { } dependencies:
module:
- media_attribution
enforced:
module:
- media_attribution
name: Licenses name: Licenses
vid: media_attribution_licenses vid: media_attribution_licenses
description: 'Licenses for content and attribution.' description: 'Licenses for content and attribution.'

2
media_attribution.module

@ -116,7 +116,7 @@ function media_attribution_preprocess_entity_embed_container(&$variables) {
$attribution_text['license'] = [ $attribution_text['license'] = [
'#type' => 'link', '#type' => 'link',
'#title' => $license_link['title'], '#title' => $license_link['title'],
'#prefix' => ' ' . t('is licensec under') . ' ', '#prefix' => ' ' . t('Licensec under') . ' ',
'#url' => Url::fromUri($license_link['uri']), '#url' => Url::fromUri($license_link['uri']),
'#suffix' => '.', '#suffix' => '.',

Loading…
Cancel
Save