Compare commits

..

No commits in common. '2.x' and '8.x-1.x' have entirely different histories.
2.x ... 8.x-1.x

  1. 2
      .github/PULL_REQUEST_TEMPLATE.md
  2. 69
      .github/workflows/build-8.x-1.x.yml
  3. 26
      .github/workflows/gitlab-mirror.yml
  4. 2
      CONTRIBUTING.md
  5. 39
      README.md
  6. 36
      composer.json
  7. 2
      config/install/islandora.settings.yml
  8. 91
      config/schema/islandora.schema.yml
  9. 3
      css/islandora.css
  10. 42
      islandora.info.yml
  11. 52
      islandora.install
  12. 5
      islandora.libraries.yml
  13. 242
      islandora.module
  14. 16
      islandora.post_update.php
  15. 15
      islandora.routing.yml
  16. 21
      islandora.services.yml
  17. 35
      islandora.tokens.inc
  18. 51
      islandora.views.inc
  19. 6
      modules/islandora_advanced_search/CONTRIBUTING.md
  20. 4
      modules/islandora_advanced_search/islandora_advanced_search.info.yml
  21. 102
      modules/islandora_advanced_search/islandora_advanced_search.module
  22. 147
      modules/islandora_advanced_search/js/facets/facets-views-ajax.js
  23. 70
      modules/islandora_advanced_search/js/facets/soft-limit.js
  24. 2
      modules/islandora_advanced_search/src/Form/AdvancedSearchForm.php
  25. 2
      modules/islandora_advanced_search/src/Plugin/Block/AdvancedSearchBlock.php
  26. 2
      modules/islandora_advanced_search/src/Plugin/Block/SearchResultsPagerBlock.php
  27. 6
      modules/islandora_audio/CONTRIBUTING.md
  28. 4
      modules/islandora_audio/README.md
  29. 3
      modules/islandora_audio/config/schema/islandora_audio.schema.yml
  30. 3
      modules/islandora_audio/islandora_audio.info.yml
  31. 2
      modules/islandora_audio/js/audio.js
  32. 9
      modules/islandora_audio/tests/src/Functional/GenerateAudioDerivativeTest.php
  33. 6
      modules/islandora_breadcrumbs/CONTRIBUTING.md
  34. 9
      modules/islandora_breadcrumbs/config/install/islandora_breadcrumbs.breadcrumbs.yml
  35. 9
      modules/islandora_breadcrumbs/config/schema/islandora_breadcrumbs.schema.yml
  36. 5
      modules/islandora_breadcrumbs/islandora_breadcrumbs.info.yml
  37. 18
      modules/islandora_breadcrumbs/islandora_breadcrumbs.install
  38. 5
      modules/islandora_breadcrumbs/islandora_breadcrumbs.links.menu.yml
  39. 7
      modules/islandora_breadcrumbs/islandora_breadcrumbs.routing.yml
  40. 2
      modules/islandora_breadcrumbs/islandora_breadcrumbs.services.yml
  41. 132
      modules/islandora_breadcrumbs/src/Form/IslandoraBreadcrumbsSettingsForm.php
  42. 69
      modules/islandora_breadcrumbs/src/IslandoraBreadcrumbBuilder.php
  43. 4
      modules/islandora_breadcrumbs/tests/src/Functional/BreadcrumbsTest.php
  44. 6
      modules/islandora_core_feature/CONTRIBUTING.md
  45. 0
      modules/islandora_core_feature/config/install/core.entity_view_mode.media.source.yml
  46. 100
      modules/islandora_core_feature/config/install/features.bundle.islandora.yml
  47. 0
      modules/islandora_core_feature/config/install/field.field.taxonomy_term.islandora_media_use.field_external_uri.yml
  48. 0
      modules/islandora_core_feature/config/install/field.field.taxonomy_term.islandora_models.field_external_uri.yml
  49. 0
      modules/islandora_core_feature/config/install/field.storage.media.field_file_size.yml
  50. 0
      modules/islandora_core_feature/config/install/field.storage.media.field_height.yml
  51. 0
      modules/islandora_core_feature/config/install/field.storage.media.field_media_audio_file.yml
  52. 0
      modules/islandora_core_feature/config/install/field.storage.media.field_media_document.yml
  53. 0
      modules/islandora_core_feature/config/install/field.storage.media.field_media_file.yml
  54. 0
      modules/islandora_core_feature/config/install/field.storage.media.field_media_image.yml
  55. 0
      modules/islandora_core_feature/config/install/field.storage.media.field_media_of.yml
  56. 0
      modules/islandora_core_feature/config/install/field.storage.media.field_media_use.yml
  57. 0
      modules/islandora_core_feature/config/install/field.storage.media.field_media_video_file.yml
  58. 0
      modules/islandora_core_feature/config/install/field.storage.media.field_mime_type.yml
  59. 0
      modules/islandora_core_feature/config/install/field.storage.media.field_original_name.yml
  60. 0
      modules/islandora_core_feature/config/install/field.storage.media.field_width.yml
  61. 0
      modules/islandora_core_feature/config/install/field.storage.node.field_member_of.yml
  62. 0
      modules/islandora_core_feature/config/install/field.storage.node.field_model.yml
  63. 4
      modules/islandora_core_feature/config/install/field.storage.node.field_weight.yml
  64. 0
      modules/islandora_core_feature/config/install/field.storage.taxonomy_term.field_external_uri.yml
  65. 5
      modules/islandora_core_feature/config/install/filehash.settings.yml
  66. 0
      modules/islandora_core_feature/config/install/migrate_plus.migration.islandora_tags.yml
  67. 0
      modules/islandora_core_feature/config/install/migrate_plus.migration_group.islandora.yml
  68. 0
      modules/islandora_core_feature/config/install/rest.resource.entity.file.yml
  69. 0
      modules/islandora_core_feature/config/install/rest.resource.entity.media.yml
  70. 0
      modules/islandora_core_feature/config/install/rest.resource.entity.node.yml
  71. 0
      modules/islandora_core_feature/config/install/rest.resource.entity.taxonomy_term.yml
  72. 0
      modules/islandora_core_feature/config/install/system.action.delete_file_as_fedora_external_content.yml
  73. 0
      modules/islandora_core_feature/config/install/system.action.delete_media_from_triplestore.yml
  74. 0
      modules/islandora_core_feature/config/install/system.action.delete_node_from_fedora.yml
  75. 0
      modules/islandora_core_feature/config/install/system.action.delete_node_from_triplestore.yml
  76. 0
      modules/islandora_core_feature/config/install/system.action.delete_taxonomy_term_in_fedora.yml
  77. 0
      modules/islandora_core_feature/config/install/system.action.delete_taxonomy_term_in_triplestore.yml
  78. 0
      modules/islandora_core_feature/config/install/system.action.index_file_as_fedora_external_content.yml
  79. 0
      modules/islandora_core_feature/config/install/system.action.index_media_in_fedora.yml
  80. 0
      modules/islandora_core_feature/config/install/system.action.index_media_in_triplestore.yml
  81. 0
      modules/islandora_core_feature/config/install/system.action.index_node_in_fedora.yml
  82. 0
      modules/islandora_core_feature/config/install/system.action.index_node_in_triplestore.yml
  83. 0
      modules/islandora_core_feature/config/install/system.action.index_taxonomy_term_in_fedora.yml
  84. 0
      modules/islandora_core_feature/config/install/system.action.index_taxonomy_term_in_the_triplestore.yml
  85. 0
      modules/islandora_core_feature/config/install/taxonomy.vocabulary.islandora_media_use.yml
  86. 0
      modules/islandora_core_feature/config/install/taxonomy.vocabulary.islandora_models.yml
  87. 1
      modules/islandora_core_feature/config/install/views.view.all_taxonomy_terms.yml
  88. 0
      modules/islandora_core_feature/config/install/views.view.display_media.yml
  89. 237
      modules/islandora_core_feature/config/install/views.view.file_checksum.yml
  90. 182
      modules/islandora_core_feature/config/install/views.view.manage_members.yml
  91. 0
      modules/islandora_core_feature/config/install/views.view.media_of.yml
  92. 1
      modules/islandora_core_feature/config/install/views.view.non_fedora_files.yml
  93. 0
      modules/islandora_core_feature/config/install/views.view.reorder_children.yml
  94. 24
      modules/islandora_core_feature/config/optional/filehash.settings.yml
  95. 16
      modules/islandora_core_feature/islandora_core_feature.features.yml
  96. 4
      modules/islandora_core_feature/islandora_core_feature.info.yml
  97. 20
      modules/islandora_core_feature/islandora_core_feature.post_update.php
  98. 6
      modules/islandora_iiif/CONTRIBUTING.md
  99. 10
      modules/islandora_iiif/README.md
  100. 26
      modules/islandora_iiif/config/schema/islandora_iiif.schema.yml
  101. Some files were not shown because too many files have changed in this diff Show More

2
.github/PULL_REQUEST_TEMPLATE.md

@ -40,4 +40,4 @@ Any additional information that you think would be helpful when reviewing this
PR.
# Interested parties
Tag (@ mention) interested parties or, if unsure, @Islandora/committers
Tag (@ mention) interested parties or, if unsure, @Islandora/8-x-committers

69
.github/workflows/build-2.x.yml → .github/workflows/build-8.x-1.x.yml

@ -1,40 +1,35 @@
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the 7.x branch
push:
branches: [ 2.x ]
branches: [ 8.x-1.x ]
pull_request:
branches: [ 2.x ]
branches: [ 8.x-1.x ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
env:
DRUPAL_VERSION: ${{ matrix.drupal-version }}
SCRIPT_DIR: ${{ github.workspace }}/islandora_ci
DRUPAL_DIR: /opt/drupal
PHPUNIT_FILE: ${{ github.workspace }}/build_dir/phpunit.xml
# The type of runner that the job will run on
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.allowed_failure }}
strategy:
fail-fast: false
matrix:
php-versions: ["8.1", "8.2", "8.3"]
php-versions: ["7.3", "7.4"]
test-suite: ["kernel", "functional", "functional-javascript"]
drupal-version: ["10.1.x", "10.2.x", "10.3.x-dev"]
mysql: ["8.0"]
allowed_failure: [false]
exclude:
- php-versions: "8.3"
drupal-version: "10.1.x"
drupal-version: ["8.9.11", "9.1.5"]
name: PHP ${{ matrix.php-versions }} | drupal ${{ matrix.drupal-version }} | mysql ${{ matrix.mysql }} | test-suite ${{ matrix.test-suite }}
name: PHP ${{ matrix.php-versions }} drupal ${{ matrix.drupal-version }} test-suite ${{ matrix.test-suite }}
services:
mysql:
image: mysql:${{ matrix.mysql }}
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: drupal
@ -47,15 +42,16 @@ jobs:
- 61616:61616
- 61613:61613
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v2
with:
path: build_dir
- name: Checkout islandora_ci
uses: actions/checkout@v4
uses: actions/checkout@v2
with:
repository: islandora/islandora_ci
ref: github-actions
@ -70,11 +66,17 @@ jobs:
- name: Setup Mysql client
run: |
sudo apt-get update
sudo apt-get remove -y mysql-client mysql-common
sudo apt-get install -y mysql-client
- name: Set environment variables
run: |
echo "DRUPAL_VERSION=${{ matrix.drupal-version }}" >> $GITHUB_ENV
echo "SCRIPT_DIR=$GITHUB_WORKSPACE/islandora_ci" >> $GITHUB_ENV
echo "DRUPAL_DIR=/opt/drupal" >> $GITHUB_ENV
echo "PHPUNIT_FILE=$GITHUB_WORKSPACE/build_dir/phpunit.xml" >> $GITHUB_ENV
- name: Cache Composer dependencies
uses: actions/cache@v3
uses: actions/cache@v2
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
@ -89,37 +91,26 @@ jobs:
- name: Setup composer paths
run: |
git -C "$GITHUB_WORKSPACE/build_dir" checkout -b github-testing
git -C "$GITHUB_WORKSPACE/build_dir" checkout -b travis-testing
cd $DRUPAL_DIR
composer config repositories.local path "$GITHUB_WORKSPACE/build_dir"
composer config minimum-stability dev
composer require "islandora/islandora:dev-github-testing as dev-2.x"
composer require "islandora/islandora:dev-travis-testing as dev-8.x-1.x"
- name: Install modules
run: |
cd $DRUPAL_DIR/web
drush --uri=127.0.0.1:8282 en -y islandora_audio islandora_breadcrumbs islandora_iiif islandora_image islandora_video islandora_text_extraction_defaults
drush --uri=127.0.0.1:8282 fim -y islandora_core_feature,islandora_text_extraction_defaults
- name: Copy PHPunit file
run: cp $PHPUNIT_FILE $DRUPAL_DIR/web/core/phpunit.xml
- name: Test scripts
run: $SCRIPT_DIR/travis_scripts.sh
- name: Start chromedriver
if: matrix.test-suite == 'functional-javascript'
run: |-
/usr/local/share/chromedriver-linux64/chromedriver \
--log-path=/tmp/chromedriver.log \
--verbose \
--allowed-ips= \
--allowed-origins=* &
- name: PHPUNIT tests
run: |
cd $DRUPAL_DIR/web/core
$DRUPAL_DIR/vendor/bin/phpunit --verbose --testsuite "${{ matrix.test-suite }}"
- name: Print chromedriver logs
if: matrix.test-suite == 'functional-javascript'
run: cat /tmp/chromedriver.log

26
.github/workflows/gitlab-mirror.yml

@ -1,26 +0,0 @@
name: Mirror and run GitLab CI
on:
push:
branches: [2.x]
tags: '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Mirror + trigger CI
uses: SvanBoxel/gitlab-mirror-and-ci-action@master
with:
args: "https://git.drupalcode.org/project/islandora"
env:
FOLLOW_TAGS: "true"
FORCE_PUSH: "false"
GITLAB_HOSTNAME: "git.drupal.org"
GITLAB_USERNAME: "project_34868_bot"
GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }}
GITLAB_PROJECT_ID: "34868"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

2
CONTRIBUTING.md

@ -62,7 +62,7 @@ Contributions to the Islandora codebase should be sent as GitHub pull requests.
Take a look at [Creating a pull request](https://help.github.com/articles/creating-a-pull-request). In a nutshell you need to:
1. [Fork](https://help.github.com/articles/fork-a-repo) this repository to your personal or institutional GitHub account (depending on the CLA you are working under). Be cautious of which branches you work from though (you'll want to base your work off the default branch). See [Fork a repo](https://help.github.com/articles/fork-a-repo) for detailed instructions.
1. [Fork](https://help.github.com/articles/fork-a-repo) this repository to your personal or institutional GitHub account (depending on the CLA you are working under). Be cautious of which branches you work from though (you'll want to base your work off master, or for Drupal modules use the most recent version branch). See [Fork a repo](https://help.github.com/articles/fork-a-repo) for detailed instructions.
2. Commit any changes to your fork.
3. Send a [pull request](https://help.github.com/articles/creating-a-pull-request) using the [pull request template](https://github.com/Islandora/documentation/blob/master/.github/PULL_REQUEST_TEMPLATE.md) to the Islandora GitHub repository that you forked in step 1. If your pull request is related to an existing issue -- for instance, because you reported a [bug/issue](https://github.com/Islandora/documentation/issues) earlier -- prefix the title of your pull request with the corresponding issue number (e.g. `issue-123: ...`). Please also include a reference to the issue in the description of the pull. This can be done by using '#' plus the issue number like so '#123', also try to pick an appropriate name for the branch in which you're issuing the pull request from.

39
README.md

@ -1,10 +1,10 @@
# Islandora
# ![Islandora](https://cloud.githubusercontent.com/assets/2371345/25624809/f95b0972-2f30-11e7-8992-a8f135402cdc.png) Islandora
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.4-8892BF.svg?style=flat-square)](https://php.net/)
[![Build Status](https://github.com/islandora/islandora/actions/workflows/build-2.x.yml/badge.svg)](https://github.com/Islandora/islandora/actions)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.2-8892BF.svg?style=flat-square)](https://php.net/)
[![Build Status](https://github.com/islandora/islandora/actions/workflows/build-8.x-1.x.yml/badge.svg)](https://github.com/Islandora/islandora/actions)
[![Contribution Guidelines](http://img.shields.io/badge/CONTRIBUTING-Guidelines-blue.svg)](./CONTRIBUTING.md)
[![LICENSE](https://img.shields.io/badge/license-GPLv2-blue.svg?style=flat-square)](./LICENSE)
[![codecov](https://codecov.io/gh/Islandora/islandora/branch/2.x/graph/badge.svg)](https://codecov.io/gh/Islandora/islandora)
[![codecov](https://codecov.io/gh/Islandora/islandora/branch/8.x-1.x/graph/badge.svg)](https://codecov.io/gh/Islandora/islandora)
## Introduction
@ -40,6 +40,7 @@ Installing via composer will download all required libraries and modules. Howev
- [eva](http://drupal.org/project/eva)
- [features](http://drupal.org/project/features)
- [migrate_plus](http://drupal.org/project/migrate_plus)
- [migrate_tools](http://drupal.org/project/migrate_tools)
- [migrate_source_csv](http://drupal.org/project/migrate_source_csv)
- [flysystem](http://drupal.org/project/flysystem)
@ -48,8 +49,6 @@ It also requires the following PHP libraries:
- [Crayfish Commons](https://packagist.org/packages/islandora/crayfish-commons)
- [Stomp PHP](http://drupal.org/project/)
If you are using a Drush version less than 10.4 you will also need to install and enable [migrate_tools](http://drupal.org/project/migrate_tools) separately.
## Installation
For a full digital repository solution, see our [installation documentation](https://islandora.github.io/documentation/installation/component_overview/).
@ -91,27 +90,27 @@ Having problems or solved a problem? Check out the Islandora google groups for a
Current maintainers:
* [Islandora Technical Advisory Group](https://github.com/Islandora/islandora-community/wiki/Technical-Advisory-Group-%28TAG%29)
* [Danny Lamb](https://github.com/dannylamb)
## Sponsors
* [American Philosophical Society](https://www.amphilsoc.org/)
* [Born-Digital, Inc.](https://www.born-digital.com/)
* [discoverygarden inc.](https://www.discoverygarden.ca/)
* [LYRASIS](https://www.lyrasis.org/)
* [McMaster University](https://www.mcmaster.ca/)
* [PALS](https://www.mnpals.org/)
* [University of Limerick](https://www.ul.ie/)
* [University of Manitoba](https://umanitoba.ca/)
* [UPEI](https://www.upei.ca/)
* [Simon Fraser University](https://www.sfu.ca/)
* [York University](https://www.yorku.ca/)
* UPEI
* discoverygarden inc.
* LYRASIS
* McMaster University
* University of Limerick
* York University
* University of Manitoba
* Simon Fraser University
* PALS
* American Philosophical Society
* Common Media Inc.
## Development
If you would like to contribute, please get involved by attending our weekly [Tech Call](https://github.com/Islandora/islandora-community/wiki/Weekly-Open-Tech-Call). We love to hear from you!
If you would like to contribute, please get involved by attending our weekly [Tech Call](https://github.com/Islandora/documentation/wiki). We love to hear from you!
If you would like to contribute code to the project, you need to be covered by an Islandora Foundation [Contributor License Agreement](https://github.com/Islandora/islandora-community/wiki/Onboarding-Checklist#contributor-license-agreements) or [Corporate Contributor License Agreement](https://github.com/Islandora/islandora-community/wiki/Onboarding-Checklist#contributor-license-agreements). Please see the [Contributor License Agreements](https://github.com/Islandora/islandora-community/wiki/Contributor-License-Agreements) page on the islandora-community wiki for more information.
If you would like to contribute code to the project, you need to be covered by an Islandora Foundation [Contributor License Agreement](http://islandora.ca/sites/default/files/islandora_cla.pdf) or [Corporate Contributor License Agreement](http://islandora.ca/sites/default/files/islandora_ccla.pdf). Please see the [Contributors](http://islandora.ca/resources/contributors) pages on Islandora.ca for more information.
We recommend using the [islandora-playbook](https://github.com/Islandora-Devops/islandora-playbook) to get started.

36
composer.json

@ -14,34 +14,34 @@
}
],
"require": {
"drupal/context": "^4 || ^5@RC",
"drupal/ctools": "^3.8 || ^4",
"drupal/eva" : "^3.0",
"drupal/file_replace": "^1.1",
"drupal/filehash": "^2 || ^3",
"drupal/flysystem" : "^2.0@alpha",
"drupal/jwt": "^1.1 || ^2",
"drupal/migrate_plus" : "^5.1 || ^6",
"drupal/migrate_source_csv" : "^3.4",
"drupal/context": "^4.0@beta",
"drupal/search_api": "~1.8",
"islandora/jsonld": "dev-8.x-1.x",
"stomp-php/stomp-php": "4.*",
"drupal/jwt": "^1.0.0-beta5",
"drupal/filehash": "^1.1",
"drupal/prepopulate" : "^2.2",
"drupal/search_api": "^1.8",
"drupal/eva" : "^2.0",
"drupal/features" : "^3.7",
"drupal/migrate_plus" : "^5.1",
"drupal/migrate_tools" : "^5.0",
"drupal/migrate_source_csv" : "^3.4",
"drupal/token" : "^1.3",
"islandora/chullo": "^2.0",
"islandora/fedora-entity-mapper": "^1.0",
"islandora/jsonld": "^2 || ^3",
"stomp-php/stomp-php": "4.* || ^5"
"drupal/flysystem" : "^2.0@alpha",
"islandora/crayfish-commons": "dev-dev",
"drupal/file_replace": "^1.1"
},
"require-dev": {
"phpunit/phpunit": "^6",
"squizlabs/php_codesniffer": "^2.7.1",
"squizlabs/php_codesniffer": "2.7.1",
"drupal/coder": "*",
"sebastian/phpcpd": "*"
},
"suggest": {
"drupal/transliterate_filenames": "Sanitizes filenames when they are uploaded so they don't break your repository.",
"drupal/coi": "Some configuration fields work with Config Override Inspector."
"drupal/transliterate_filenames": "Sanitizes filenames when they are uploaded so they don't break your repository."
},
"license": "GPL-2.0-or-later",
"license": "GPL-2.0+",
"authors": [
{
"name": "Islandora Foundation",

2
config/install/islandora.settings.yml

@ -1,4 +1,4 @@
broker_url: 'tcp://localhost:61613'
jwt_expiry: '+2 hour'
delete_media_and_files: TRUE
gemini_url: ''
gemini_pseudo_bundles: []

91
config/schema/islandora.schema.yml

@ -14,18 +14,15 @@ islandora.settings:
jwt_expiry:
type: string
label: 'How long JWTs should last before expiring.'
delete_media_and_files:
type: boolean
label: 'Node Delete with Media and Files'
redirect_after_media_save:
type: boolean
label: 'Redirect to node after media save.'
upload_form_location:
type: string
label: 'Upload Form Location'
upload_form_allowed_mimetypes:
type: string
label: 'Upload Form Allowed Extensions'
gemini_url:
type: uri
label: 'Url to Gemini microservice'
gemini_pseudo_bundles:
type: sequence
label: 'List of node, media and taxonomy terms that should include the linked Fedora URI'
@ -90,14 +87,6 @@ condition.plugin.node_has_term:
logic:
type: string
label: 'Logic (AND or OR)'
tids:
type: sequence
sequence:
type: mapping
mapping:
target_id:
type: integer
label: The target taxonomy term IDs
condition.plugin.node_has_parent:
type: condition.plugin
@ -171,74 +160,12 @@ condition.plugin.node_had_namespace:
label: 'PID field'
field.formatter.settings.islandora_image:
type: field.formatter.settings.image
label: 'Islandora image field display format settings'
condition.plugin.islandora_entity_bundle:
type: condition.plugin
mapping:
bundles:
type: sequence
sequence:
type: string
condition.plugin.media_source_mimetype:
type: condition.plugin
mapping:
mimetype:
type: string
reaction.plugin.alter_jsonld_type:
type: islandora.reaction_plugin_with_saved
mapping:
source_field:
type: string
islandora.reaction_plugin_with_saved:
type: reaction.plugin
mapping:
saved:
type: boolean
label: Default config upstream; however, left undefined in the schema.
reaction.plugin.islandora_map_uri_predicate:
type: islandora.reaction_plugin_with_saved
type: mapping
label: 'Image field display format settings'
mapping:
drupal_uri_predicate:
image_link:
type: string
reaction.plugin.view_mode_alter:
type: islandora.reaction_plugin_with_saved
mapping:
mode:
label: 'Link image to'
image_style:
type: string
label: The view mode to which to switch
islandora.reaction.actions:
type: islandora.reaction_plugin_with_saved
mapping:
actions:
type: sequence
sequence:
type: string
reaction.plugin.index:
type: islandora.reaction.actions
reaction.plugin.delete:
type: islandora.reaction.actions
reaction.plugin.derivative:
type: islandora.reaction.actions
field.widget.settings.media_track:
type: field.widget.settings.file_generic
field.field_settings.media_track:
type: field.field_settings.file
mapping:
languages:
type: string
field.storage_settings.media_track:
type: field.storage_settings.file
label: 'Image style'

3
css/islandora.css

@ -1,3 +0,0 @@
.container .islandora-media-items {
margin: 0;
}

42
islandora.info.yml

@ -4,30 +4,32 @@ name: 'islandora'
description: "Islandora Core"
type: module
package: Islandora
core_version_requirement: ^9 || ^10
core: 8.x
core_version_requirement: ^8 || ^9
dependencies:
- context:context_ui
- ctools:ctools
- drupal:action
- drupal:basic_auth
- drupal:block
- drupal:content_translation
- drupal:link
- drupal:media
- drupal:node
- drupal:options
- drupal:path
- drupal:text
- drupal:options
- drupal:link
- drupal:jsonld
- drupal:search_api
- drupal:jwt
- drupal:rest
- drupal:filehash
- drupal:basic_auth
- drupal:context_ui
- drupal:action
- drupal:eva
- drupal:taxonomy
- drupal:text
- drupal:views_ui
- eva:eva
- file_replace:file_replace
- filehash:filehash
- flysystem:flysystem
- jsonld:jsonld
- jwt:jwt
- migrate_source_csv:migrate_source_csv
- prepopulate:prepopulate
- search_api:search_api
- token:token
- drupal:media
- drupal:prepopulate
- drupal:features_ui
- drupal:migrate_tools
- drupal:migrate_source_csv
- drupal:content_translation
- drupal:flysystem
- drupal:token
- drupal:file_replace

52
islandora.install

@ -5,10 +5,6 @@
* Install/update hook implementations.
*/
use Drupal\Core\Extension\ExtensionNameLengthException;
use Drupal\Core\Extension\MissingDependencyException;
use Drupal\Core\Utility\UpdateException;
/**
* Adds common namespaces to jsonld.settings.
*/
@ -178,51 +174,3 @@ function update_jsonld_included_namespaces() {
->warning("Could not find required jsonld.settings to add default RDF namespaces.");
}
}
/**
* Ensure that ctools is enabled.
*/
function islandora_update_8007() {
$module_handler = \Drupal::moduleHandler();
if ($module_handler->moduleExists('ctools')) {
return t('The "@module_name" module is already enabled, no action necessary.', [
'@module_name' => 'ctools',
]);
}
/** @var \Drupal\Core\Extension\ModuleInstallerInterface $installer */
$installer = \Drupal::service('module_installer');
try {
if ($installer->install(['ctools'], TRUE)) {
return t('The "@module_name" module was enabled successfully.', [
'@module_name' => 'ctools',
]);
}
}
catch (ExtensionNameLengthException | MissingDependencyException $e) {
throw new UpdateException('Failed; ensure that the ctools module is available in the Drupal installation.', 0, $e);
}
catch (\Exception $e) {
throw new UpdateException('Failed; encountered an exception while trying to enable ctools.', 0, $e);
}
// Theoretically impossible to hit, as ModuleInstaller::install() only returns
// TRUE (or throws/propagates an exception), but... probably a good idea to
// have the here, just in case?
throw new UpdateException('Failed; hit the end of the update hook implementation, which is not expected.');
}
/**
* Set config to no redirect after media save.
*/
function islandora_update_8008() {
$config = \Drupal::configFactory()->getEditable('islandora.settings');
if ($config) {
$config->set('redirect_after_media_save', FALSE);
$config->save(TRUE);
return t('A new configuration option, "Redirect after media save" is now available.
It has been turned off to preserve existing behaviour. To enable this setting visit
Configuration > Islandora > Core Settings.');
}
}

5
islandora.libraries.yml

@ -1,5 +0,0 @@
islandora:
version: VERSION
css:
theme:
css/islandora.css: {}

242
islandora.module

@ -26,9 +26,6 @@ use Drupal\media\MediaInterface;
use Drupal\file\FileInterface;
use Drupal\taxonomy\TermInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\serialization\Normalizer\CacheableNormalizerInterface;
use Drupal\Core\Entity\EntityForm;
use Drupal\file\Entity\File;
/**
* Implements hook_help().
@ -183,8 +180,7 @@ function islandora_file_insert(FileInterface $file) {
*/
function islandora_file_update(FileInterface $file) {
// Exit early if unchanged.
if ($file->hasField('sha1') && $file->original->hasField('sha1')
&& $file->sha1->getString() == $file->original->sha1->getString()) {
if ($file->filehash != NULL && $file->original->filehash != NULL && $file->filehash['sha1'] == $file->original->filehash['sha1']) {
return;
}
@ -255,8 +251,8 @@ function islandora_jsonld_alter_normalized_array(EntityInterface $entity, array
$reaction->execute($entity, $normalized, $context);
foreach ($context_manager->getActiveContexts() as $context_config) {
try {
if ($context_config->getReaction($reaction->getPluginId()) && isset($context[CacheableNormalizerInterface::SERIALIZATION_CONTEXT_CACHEABILITY])) {
$context[CacheableNormalizerInterface::SERIALIZATION_CONTEXT_CACHEABILITY]->addCacheableDependency($context_config);
if ($context_config->getReaction($reaction->getPluginId())) {
$context['cacheability']->addCacheTags($context_config->getCacheTags());
};
}
catch (PluginNotFoundException $e) {
@ -332,227 +328,19 @@ function islandora_form_alter(&$form, FormStateInterface $form_state, $form_id)
if ($node) {
$form['name']['widget'][0]['value']['#default_value'] = $node->getTitle();
}
$form['actions']['submit']['#submit'][] = 'islandora_media_custom_form_submit';
}
}
$form_object = $form_state->getFormObject();
$utils = \Drupal::service('islandora.utils');
$config = \Drupal::config('islandora.settings')->get('delete_media_and_files');
if ($config == 1 && $form_object instanceof EntityForm) {
$entity = $form_object->getEntity();
if ($entity->getEntityTypeId() == "node" && $utils->isIslandoraType($entity->getEntityTypeId(), $entity->bundle()) && strpos($form['#form_id'], 'delete_form') !== FALSE) {
$medias = $utils->getMedia($form_state->getFormObject()->getEntity());
if (count($medias) != 0) {
$form['delete_associated_content'] = [
'#type' => 'checkbox',
'#title' => t('Delete all associated medias and nodes'),
];
$media_list = [];
foreach ($medias as $media) {
$media_list[] = $media->getName();
}
$form['container'] = [
'#type' => 'container',
'#states' => [
'visible' => [
':input[name="delete_associated_content"]' => ['checked' => TRUE],
],
],
];
$form['container']['media_items'] = [
'#theme' => 'item_list',
'#type' => 'ul',
'#items' => $media_list,
'#attributes' => ['class' => ['islandora-media-items']],
'#wrapper_attributes' => ['class' => ['container']],
'#attached' => [
'library' => [
'islandora/islandora',
],
],
];
$form['actions']['submit']['#submit'][] = 'islandora_object_delete_form_submit';
return $form;
}
}
}
return $form;
}
/**
* Redirect submit handler for media save.
*/
function islandora_media_custom_form_submit(&$form, FormStateInterface $form_state) {
// Check configuration to see whether a redirect is desired.
$redirect = \Drupal::config('islandora.settings')->get('redirect_after_media_save');
if ($redirect) {
$params = \Drupal::request()->query->all();
if (!empty($params)) {
$target_id = $params['edit']['field_media_of']['widget'][0]['target_id'];
$url = Url::fromRoute('view.media_of.page_1', ['node' => $target_id]);
$form_state->setRedirectUrl($url);
}
}
}
/**
* Implements a submit handler for the delete form.
*/
function islandora_object_delete_form_submit($form, FormStateInterface $form_state) {
$result = $form_state->getValues('delete_associated_content');
$utils = \Drupal::service('islandora.utils');
if ($result['delete_associated_content'] == 1) {
$node = $form_state->getFormObject()->getEntity();
$medias = $utils->getMedia($node);
$media_list = [];
$entity_field_manager = \Drupal::service('entity_field.manager');
$current_user = \Drupal::currentUser();
$logger = \Drupal::logger('logger.channel.islandora');
$messenger = \Drupal::messenger();
$delete_media = [];
$media_translations = [];
$media_files = [];
$entity_protected_medias = [];
$inaccessible_entities = [];
foreach ($medias as $id => $media) {
$lang = $media->language()->getId();
$selected_langcodes[$lang] = $lang;
if (!$media->access('delete', $current_user)) {
$inaccessible_entities[] = $media;
continue;
}
// Check for files.
$fields = $entity_field_manager->getFieldDefinitions('media', $media->bundle());
foreach ($fields as $field) {
$type = $field->getType();
if ($type == 'file' || $type == 'image') {
$target_id = $media->get($field->getName())->target_id;
$file = File::load($target_id);
if ($file) {
if (!$file->access('delete', $current_user)) {
$inaccessible_entities[] = $file;
continue;
}
$media_files[$id][$file->id()] = $file;
}
}
}
foreach ($selected_langcodes as $langcode) {
// We're only working with media, which are translatable.
$entity = $media->getTranslation($langcode);
if ($entity->isDefaultTranslation()) {
$delete_media[$id] = $entity;
unset($media_translations[$id]);
}
elseif (!isset($delete_media[$id])) {
$media_translations[$id][] = $entity;
}
}
}
if ($delete_media) {
foreach ($delete_media as $id => $media) {
try {
$media->delete();
$media_list[] = $id;
$logger->notice('The media %label has been deleted.', [
'%label' => $media->label(),
]);
}
catch (Exception $e) {
$entity_protected_medias[] = $id;
}
}
}
$delete_files = array_filter($media_files, function ($media) use ($entity_protected_medias) {
return !in_array($media, $entity_protected_medias);
}, ARRAY_FILTER_USE_KEY);
if ($delete_files) {
foreach ($delete_files as $files_array) {
foreach ($files_array as $file) {
$file->delete();
$logger->notice('The file %label has been deleted.', [
'%label' => $file->label(),
]);
}
}
}
$delete_media_translations = array_filter($media_translations, function ($media) use ($entity_protected_medias) {
return !in_array($media, $entity_protected_medias);
}, ARRAY_FILTER_USE_KEY);
if ($delete_media_translations) {
foreach ($delete_media_translations as $id => $translations) {
$media = $medias[$id];
foreach ($translations as $translation) {
$media->removeTranslation($translation->language()->getId());
}
$media->save();
foreach ($translations as $translation) {
$logger->notice('The media %label @language translation has been deleted', [
'%label' => $media->label(),
'@language' => $translation->language()->getName(),
]);
}
}
}
if ($inaccessible_entities) {
$messenger->addWarning("@count items have not been deleted because you do not have the necessary permissions.", [
'@count' => count($inaccessible_entities),
]);
}
$build = [
'heading' => [
'#type' => 'html_tag',
'#tag' => 'div',
'#value' => t("The repository item @node and @media", [
'@node' => $node->getTitle(),
'@media' => \Drupal::translation()->formatPlural(
count($media_list), 'the media with the id @media has been deleted.',
'the medias with the ids @media have been deleted.',
['@media' => implode(", ", $media_list)],
),
]),
],
];
$message = \Drupal::service('renderer')->renderPlain($build);
$messenger->deleteByType('status');
$messenger->addStatus($message);
}
}
/**
* Implements hook_field_widget_single_element_WIDGET_TYPE_form_alter().
* Implements hook_field_widget_WIDGET_TYPE_form_alter().
*/
function islandora_field_widget_single_element_image_image_form_alter(&$element, $form_state, $context) {
function islandora_field_widget_image_image_form_alter(&$element, $form_state, $context) {
$element['#process'][] = 'islandora_add_default_image_alt_text';
}
/**
* Callback for hook_field_widget_single_element_WIDGET_TYPE_form_alter().
* Callback for hook_field_widget_WIDGET_TYPE_form_alter().
*/
function islandora_add_default_image_alt_text($element, $form_state, $form) {
if ($element['alt']['#access']) {
@ -615,7 +403,6 @@ function islandora_form_block_form_alter(&$form, FormStateInterface $form_state,
unset($form['visibility']['media_is_islandora_media']);
unset($form['visibility']['media_uses_filesystem']);
unset($form['visibility']['node_had_namespace']);
unset($form['visibility']['node_has_ancestor']);
unset($form['visibility']['node_has_parent']);
unset($form['visibility']['node_has_term']);
unset($form['visibility']['node_is_islandora_object']);
@ -634,8 +421,8 @@ function islandora_entity_extra_field_info() {
if (!empty($pseudo_bundles)) {
foreach ($pseudo_bundles as $key) {
[$bundle, $content_entity] = explode(":", $key);
$extra_field[$content_entity][$bundle]['display'][IslandoraSettingsForm::GEMINI_PSEUDO_FIELD] = [
list($bundle, $content_entity) = explode(":", $key);
$extra_field[$content_entity][$bundle]['display']['field_gemini_uri'] = [
'label' => t('Fedora URI'),
'description' => t('The URI to the persistent'),
'weight' => 100,
@ -663,17 +450,6 @@ function islandora_entity_view(array &$build, EntityInterface $entity, EntityVie
// Check if the source file is in Fedora or not.
$media_source_service = \Drupal::service('islandora.media_source_service');
$source_file = $media_source_service->getSourceFile($entity);
if (!$source_file) {
\Drupal::logger('islandora')->error(
\Drupal::service('string_translation')->translate(
"Can't get source file for @label (@id)", [
'@label' => $entity->label(),
"@id" => $entity->id(),
]
)
);
return;
}
$uri = $source_file->getFileUri();
$scheme = \Drupal::service('stream_wrapper_manager')->getScheme($uri);
$flysystem_config = Settings::get('flysystem');
@ -727,7 +503,7 @@ function islandora_preprocess_views_view_table(&$variables) {
// Check for a weight selector field.
foreach ($variables['view']->field as $field_key => $field) {
if ($field->getPluginId() == 'integer_weight_selector') {
if ($field->options['plugin_id'] == 'integer_weight_selector') {
// Check if the weight selector is on the first column.
$is_first_column = array_search($field_key, array_keys($variables['view']->field)) > 0 ? FALSE : TRUE;

16
islandora.post_update.php

@ -1,16 +0,0 @@
<?php
/**
* @file
* Post updates.
*/
/**
* Set default value for delete_media_and_files field in settings.
*/
function islandora_post_update_delete_media_and_files() {
$config_factory = \Drupal::configFactory();
$config = $config_factory->getEditable('islandora.settings');
$config->set('delete_media_and_files', TRUE);
$config->save(TRUE);
}

15
islandora.routing.yml

@ -37,15 +37,15 @@ islandora.add_member_to_node_page:
_entity_create_any_access: 'node'
islandora.upload_children:
path: '/node/{node}/members/upload/{step}'
path: '/node/{node}/members/upload'
defaults:
_wizard: '\Drupal\islandora\Form\AddChildrenWizard\ChildForm'
_form: '\Drupal\islandora\Form\AddChildrenForm'
_title: 'Upload Children'
step: 'type_selection'
options:
_admin_route: 'TRUE'
requirements:
_custom_access: '\Drupal\islandora\Form\AddChildrenWizard\Access::childAccess'
_access: 'TRUE'
#_permssion: 'create node,create media'
islandora.add_media_to_node_page:
path: '/node/{node}/media/add'
@ -59,15 +59,14 @@ islandora.add_media_to_node_page:
_entity_create_any_access: 'media'
islandora.upload_media:
path: '/node/{node}/media/upload/{step}'
path: '/node/{node}/media/upload'
defaults:
_wizard: '\Drupal\islandora\Form\AddChildrenWizard\MediaForm'
_form: '\Drupal\islandora\Form\AddMediaForm'
_title: 'Add media'
step: 'type_selection'
options:
_admin_route: 'TRUE'
requirements:
_custom_access: '\Drupal\islandora\Form\AddChildrenWizard\Access::mediaAccess'
_custom_access: '\Drupal\islandora\Form\AddMediaForm::access'
islandora.media_source_update:
path: '/media/{media}/source'

21
islandora.services.yml

@ -31,9 +31,6 @@ services:
logger.channel.islandora:
parent: logger.channel_base
arguments: ['islandora']
logger.channel.fedora_flysystem:
parent: logger.channel_base
arguments: ['fedora_flysystem']
islandora.media_route_context_provider:
class: Drupal\islandora\ContextProvider\MediaRouteContextProvider
arguments: ['@current_route_match']
@ -56,25 +53,9 @@ services:
class: Drupal\islandora\IslandoraUtils
arguments: ['@entity_type.manager', '@entity_field.manager', '@context.manager', '@flysystem_factory', '@language_manager']
islandora.entity_mapper:
class: Islandora\EntityMapper\EntityMapper
class: Islandora\Crayfish\Commons\EntityMapper\EntityMapper
islandora.stomp.auth_header_listener:
class: Drupal\islandora\EventSubscriber\StompHeaderEventSubscriber
arguments: ['@jwt.authentication.jwt']
tags:
- { name: event_subscriber }
islandora.upload_children.batch_processor:
class: Drupal\islandora\Form\AddChildrenWizard\ChildBatchProcessor
arguments:
- '@entity_type.manager'
- '@database'
- '@current_user'
- '@messenger'
- '@date.formatter'
islandora.upload_media.batch_processor:
class: Drupal\islandora\Form\AddChildrenWizard\MediaBatchProcessor
arguments:
- '@entity_type.manager'
- '@database'
- '@current_user'
- '@messenger'
- '@date.formatter'

35
islandora.tokens.inc

@ -19,18 +19,6 @@ function islandora_token_info() {
'name' => t('Islandora Tokens'),
'description' => t('Tokens for Islandora objects.'),
];
$node['media-original-file:filename'] = [
'name' => t('Media: Original File filename without extension.'),
'description' => t('File name without extension of original uploaded file associated with Islandora Object via Media.'),
];
$node['media-original-file:basename'] = [
'name' => t('Media: Original File filename with extension.'),
'description' => t('File name with extension of original uploaded file associated with Islandora Object via Media.'),
];
$node['media-original-file:extension'] = [
'name' => t('Media: Original File extension.'),
'description' => t('File extension of original uploaded file associated with Islandora Object via Media.'),
];
$node['media-thumbnail-image:url'] = [
'name' => t('Media: Thumbnail Image URL.'),
'description' => t('URL of Thumbnail Image associated with Islandora Object via Media.'),
@ -82,24 +70,6 @@ function islandora_tokens($type, $tokens, array $data, array $options, Bubbleabl
$islandoraUtils = \Drupal::service('islandora.utils');
foreach ($tokens as $name => $original) {
switch ($name) {
case 'media-original-file:basename':
case 'media-original-file:filename':
case 'media-original-file:extension':
$term = $islandoraUtils->getTermForUri('http://pcdm.org/use#OriginalFile');
$media = $islandoraUtils->getMediaWithTerm($data['node'], $term);
// Is there media?
if ($media) {
$file = \Drupal::service('islandora.media_source_service')->getSourceFile($media);
if (!empty($file)) {
$path_info = pathinfo($file->createFileUrl());
$key = explode(':', $name)[1];
if (array_key_exists($key, $path_info)) {
$replacements[$original] = $path_info[$key];
}
}
}
break;
case 'media-thumbnail-image:url':
case 'media_thumbnail_image:url':
$term = $islandoraUtils->getTermForUri('http://pcdm.org/use#ThumbnailImage');
@ -109,7 +79,7 @@ function islandora_tokens($type, $tokens, array $data, array $options, Bubbleabl
if ($media) {
$file = \Drupal::service('islandora.media_source_service')->getSourceFile($media);
if (!empty($file)) {
$url = $file->createFileUrl();
$url = $file->url();
$replacements[$original] = $url;
}
}
@ -134,7 +104,7 @@ function islandora_tokens($type, $tokens, array $data, array $options, Bubbleabl
break;
case 'pdf_url':
$replacements[$original] = islandora_url_to_service_file_media_by_mimetype($data['node'], 'application/pdf');
$replacements[$original] = ' ' . islandora_url_to_service_file_media_by_mimetype($data['node'], 'application/pdf');
break;
}
}
@ -188,5 +158,4 @@ function islandora_url_to_service_file_media_by_mimetype($node, $mime_type) {
}
}
}
return '';
}

51
islandora.views.inc

@ -9,46 +9,17 @@
* Implements hook_views_data_alter().
*/
function islandora_views_data_alter(&$data) {
// For now only support Nodes and Media.
foreach (['node', 'media'] as $entity_type) {
$fields = \Drupal::service('entity_field.manager')->getFieldStorageDefinitions($entity_type);
foreach ($fields as $field => $field_storage_definition) {
if ($field_storage_definition->getType() == 'integer' && strpos($field, "field_") === 0) {
$prefixed_field = $entity_type . '__' . $field;
if (isset($data[$prefixed_field])) {
$data[$prefixed_field][$field . '_value']['field'] = $data[$prefixed_field][$field]['field'];
$data[$prefixed_field][$field]['title'] = t('Integer Weight Selector (@field)', [
'@field' => $field,
]);
$data[$prefixed_field][$field]['help'] = t('Provides a drag-n-drop reordering of integer-based weight fields.');
$data[$prefixed_field][$field]['title short'] = t('Integer weight selector');
$data[$prefixed_field][$field]['field']['id'] = 'integer_weight_selector';
}
}
// For now only support Nodes.
$fields = \Drupal::service('entity_field.manager')->getFieldStorageDefinitions('node');
foreach ($fields as $field => $field_storage_definition) {
if ($field_storage_definition->getType() == 'integer' && strpos($field, "field_") === 0) {
$data['node__' . $field][$field . '_value']['field'] = $data['node__' . $field][$field]['field'];
$data['node__' . $field][$field]['title'] = t('Integer Weight Selector (@field)', [
'@field' => $field,
]);
$data['node__' . $field][$field]['help'] = t('Provides a drag-n-drop reordering of integer-based weight fields.');
$data['node__' . $field][$field]['title short'] = t('Integer weight selector');
$data['node__' . $field][$field]['field']['id'] = 'integer_weight_selector';
}
}
// Add Has Media filter.
$data['node_field_data']['islandora_has_media'] = [
'title' => t('Node has Media Use'),
'group' => t('Content'),
'filter' => [
'title' => t('Node has media use filter'),
'help' => t('Provides a custom filter for nodes that do or do not have media with a given use.'),
'field' => 'nid',
'id' => 'islandora_node_has_media_use',
],
];
// Add Is Islandora filter.
$data['node_field_data']['islandora_node_is_islandora'] = [
'title' => t('Node is Islandora'),
'group' => t('Content'),
'filter' => [
'title' => t('Node is Islandora'),
'help' => t('Node has a content type that possesses the mandatory Islandora fields.'),
'field' => 'nid',
'id' => 'islandora_node_is_islandora',
],
];
}

6
modules/islandora_advanced_search/CONTRIBUTING.md

@ -16,7 +16,7 @@ If you would like to submit a use case to the Islandora 8 project, please submit
### Documentation
You can contribute documentation in two different ways. One way is to create an issue [here](https://github.com/Islandora/documentation/issues/new), prepending "Documentation:" to the title of the issue. Another way is by pull request, which is the same process as [Contribute Code](https://github.com/Islandora/documentation/blob/main/CONTRIBUTING.md#contribute-code). All documentation resides in [`docs`](https://github.com/Islandora/documentation/tree/main/docs).
You can contribute documentation in two different ways. One way is to create an issue [here](https://github.com/Islandora/documentation/issues/new), prepending "Documentation:" to the title of the issue. Another way is by pull request, which is the same process as [Contribute Code](https://github.com/Islandora/documentation/blob/master/CONTRIBUTING.md#contribute-code). All documentation resides in [`docs`](https://github.com/Islandora/documentation/tree/master/docs).
### Request a new feature
@ -62,9 +62,9 @@ Contributions to the Islandora codebase should be sent as GitHub pull requests.
Take a look at [Creating a pull request](https://help.github.com/articles/creating-a-pull-request). In a nutshell you need to:
1. [Fork](https://help.github.com/articles/fork-a-repo) this repository to your personal or institutional GitHub account (depending on the CLA you are working under). Be cautious of which branches you work from though (you'll want to base your work off the default branch). See [Fork a repo](https://help.github.com/articles/fork-a-repo) for detailed instructions.
1. [Fork](https://help.github.com/articles/fork-a-repo) this repository to your personal or institutional GitHub account (depending on the CLA you are working under). Be cautious of which branches you work from though (you'll want to base your work off master, or for Drupal modules use the most recent version branch). See [Fork a repo](https://help.github.com/articles/fork-a-repo) for detailed instructions.
2. Commit any changes to your fork.
3. Send a [pull request](https://help.github.com/articles/creating-a-pull-request) using the [pull request template](https://github.com/Islandora/documentation/blob/main/.github/PULL_REQUEST_TEMPLATE.md) to the Islandora GitHub repository that you forked in step 1. If your pull request is related to an existing issue -- for instance, because you reported a [bug/issue](https://github.com/Islandora/documentation/issues) earlier -- prefix the title of your pull request with the corresponding issue number (e.g. `issue-123: ...`). Please also include a reference to the issue in the description of the pull. This can be done by using '#' plus the issue number like so '#123', also try to pick an appropriate name for the branch in which you're issuing the pull request from.
3. Send a [pull request](https://help.github.com/articles/creating-a-pull-request) using the [pull request template](https://github.com/Islandora/documentation/blob/master/.github/PULL_REQUEST_TEMPLATE.md) to the Islandora GitHub repository that you forked in step 1. If your pull request is related to an existing issue -- for instance, because you reported a [bug/issue](https://github.com/Islandora/documentation/issues) earlier -- prefix the title of your pull request with the corresponding issue number (e.g. `issue-123: ...`). Please also include a reference to the issue in the description of the pull. This can be done by using '#' plus the issue number like so '#123', also try to pick an appropriate name for the branch in which you're issuing the pull request from.
You may want to read [Syncing a fork](https://help.github.com/articles/syncing-a-fork) for instructions on how to keep your fork up to date with the latest changes of the upstream (official) repository.

4
modules/islandora_advanced_search/islandora_advanced_search.info.yml

@ -4,10 +4,8 @@ name: 'Islandora Advanced Search'
description: "Creates an Advanced Search block and other enhancements to search."
type: module
package: Islandora
core_version_requirement: ^9 || ^10
core_version_requirement: ^8 || ^9
dependencies:
- drupal:facets
- drupal:facets_summary
- drupal:search_api_solr
lifecycle: deprecated
lifecycle_link: https://groups.google.com/g/islandora/c/SEOAWJrfE_M

102
modules/islandora_advanced_search/islandora_advanced_search.module

@ -13,13 +13,51 @@
*/
use Drupal\block\Entity\Block;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Form\FormStateInterface;
use Drupal\islandora_advanced_search\AdvancedSearchQuery;
use Drupal\islandora_advanced_search\Form\SettingsForm;
use Drupal\islandora_advanced_search\Utilities;
use Drupal\search_api\Query\QueryInterface as DrupalQueryInterface;
use Drupal\views\ViewExecutable;
use Solarium\Core\Query\QueryInterface as SolariumQueryInterface;
/**
* Implements hook_theme().
*/
function islandora_advanced_search_theme() {
return [
'facets_item_list__include_exclude_links' => [
'template' => 'facets/facets-item-list--include-exclude-links',
'base hook' => 'facets_item_list',
],
'facets_result_item__include_exclude_links' => [
'template' => 'facets/facets-result-item--include-exclude-links',
'base hook' => 'facets_result_item',
],
'facets_result_item__summary' => [
'template' => 'facets/facets-result-item--summary',
'base hook' => 'facets_result_item',
],
];
}
/**
* Implements hook_library_info_alter().
*/
function islandora_advanced_search_library_info_alter(&$libraries, $extension) {
if ($extension == 'facets') {
// Override facets module javascript with customizations.
$path = '/' . drupal_get_path('module', 'islandora_advanced_search') . '/js/facets';
$libraries['soft-limit']['js'] = [
"$path/soft-limit.js" => [],
];
$libraries['drupal.facets.views-ajax']['js'] = [
"$path/facets-views-ajax.js" => [],
];
}
}
/**
* Implements hook_search_api_solr_converted_query_alter().
*/
@ -61,6 +99,20 @@ function islandora_advanced_search_form_block_form_alter(&$form, FormStateInterf
$form['visibility'][$condition_id] = $condition_form;
}
/**
* Implements hook_preprocess_block__facets_summary().
*/
function islandora_advanced_search_preprocess_block__facets_summary(&$variables) {
// Copy data-attributes to the content as the javascript expects
// there to be no elements between the data declaration and the
// content of the block.
foreach ($variables['attributes'] as $key => $value) {
if (substr($key, 0, 4) === "data") {
$variables['content_attributes'][$key] = $value;
}
}
}
/**
* Implements hook_preprocess_preprocess_views_view().
*/
@ -87,3 +139,53 @@ function islandora_advanced_search_views_pre_view(ViewExecutable $view, $display
$advanced_search_query = new AdvancedSearchQuery();
$advanced_search_query->alterView(\Drupal::request(), $view, $display_id);
}
/**
* Implements hook_preprocess_facets_summary_item_list().
*/
function islandora_advanced_search_preprocess_facets_summary_item_list(&$variables) {
foreach ($variables['items'] as &$item) {
$item['attributes']['class'][] = 'facet-summary-item';
}
}
/**
* Implements hook_preprocess_facets_item_list().
*/
function islandora_advanced_search_preprocess_facets_item_list(&$variables) {
$widget = $variables['facet']->getWidget();
$soft_limit = $widget['config']['soft_limit'];
// Break into two groups less / more which can display be toggled as a single
// element change rather than showing / hiding all <li> elements individually.
// As its slow and causes the page to snap when loading.
$variables['less'] = array_slice($variables['items'], 0, $soft_limit);
$variables['more'] = array_slice($variables['items'], $soft_limit);
$variables['show_more_label'] = $widget['config']['soft_limit_settings']['show_more_label'];
}
/**
* Implements hook_preprocess_facets_result_item().
*/
function islandora_advanced_search_preprocess_facets_result_item(&$variables) {
$settings = \Drupal::config(SettingsForm::CONFIG_NAME);
$length = $settings->get(SettingsForm::FACET_TRUNCATE);
if (is_numeric($length)) {
// Limit the length of facets display to at most 32 characters.
if (is_string($variables['value'])) {
$variables['value'] = Unicode::truncate(
$variables['value'],
$length,
TRUE,
TRUE
);
}
elseif (is_string($variables['value']['text']['#title'])) {
$variables['value']['text']['#title'] = Unicode::truncate(
$variables['value']['text']['#title'],
$length,
TRUE,
TRUE
);
}
}
}

147
modules/islandora_advanced_search/js/facets/facets-views-ajax.js

@ -0,0 +1,147 @@
//# sourceURL=modules/contrib/islandora/modules/islandora_advanced_search/js/facets/facets-view.ajax.js
/**
* @file
* Overrides the facets-view-ajax.js behavior from the 'facets' module.
*/
(function ($, Drupal) {
"use strict";
// Generate events on push state.
(function (history) {
var pushState = history.pushState;
history.pushState = function (state, title, url) {
var ret = pushState.apply(this, arguments);
var event = new Event("pushstate");
window.dispatchEvent(event);
return ret;
};
})(window.history);
function reload(url) {
// Update View.
if (drupalSettings && drupalSettings.views && drupalSettings.views.ajaxViews) {
var view_path = drupalSettings.views.ajax_path;
$.each(drupalSettings.views.ajaxViews, function (views_dom_id) {
var views_parameters = Drupal.Views.parseQueryString(url);
var views_arguments = Drupal.Views.parseViewArgs(url, "search");
var views_settings = $.extend(
{},
Drupal.views.instances[views_dom_id].settings,
views_arguments,
views_parameters
);
var views_ajax_settings =
Drupal.views.instances[views_dom_id].element_settings;
views_ajax_settings.submit = views_settings;
views_ajax_settings.url =
view_path + "?" + $.param(Drupal.Views.parseQueryString(url));
Drupal.ajax(views_ajax_settings).execute();
});
}
// Replace filter, pager, summary, and facet blocks.
var blocks = {};
$(
".block[class*='block-plugin-id--islandora-advanced-search-result-pager'], .block[class*='block-plugin-id--views-exposed-filter-block'], .block[class*='block-plugin-id--facet']"
).each(function () {
var id = $(this).attr("id");
var block_id = id
.slice("block-".length, id.length)
.replace(/--.*$/g, "")
.replace(/-/g, "_");
blocks[block_id] = "#" + id;
});
Drupal.ajax({
url: Drupal.url("islandora-advanced-search-ajax-blocks"),
submit: {
link: url,
blocks: blocks,
},
}).execute();
}
// On location change reload all the blocks / ajax view.
window.addEventListener("pushstate", function (e) {
reload(window.location.href);
});
window.addEventListener("popstate", function (e) {
if (e.state != null) {
reload(window.location.href);
}
});
/**
* Push state on form/pager/facet change.
*/
Drupal.behaviors.islandoraAdvancedSearchViewsAjax = {
attach: function (context, settings) {
window.historyInitiated = true;
// Remove existing behavior from form.
if (settings && settings.views && settings.views.ajaxViews) {
$.each(settings.views.ajaxViews, function (index, settings) {
var exposed_form = $(
"form#views-exposed-form-" +
settings.view_name.replace(/_/g, "-") +
"-" +
settings.view_display_id.replace(/_/g, "-")
);
exposed_form
.once()
.find("input[type=submit], input[type=image]")
.not("[data-drupal-selector=edit-reset]")
.each(function (index) {
$(this).unbind("click");
$(this).click(function (e) {
// Let ctrl/cmd click open in a new window.
if (e.shiftKey || e.ctrlKey || e.metaKey) {
return;
}
e.preventDefault();
e.stopPropagation();
var href = window.location.href;
var params = Drupal.Views.parseQueryString(href);
// Remove the page if set as submitting the form should always take
// the user to the first page (facets do the same).
delete params.page;
// Include values from the form in the URL.
$.each(exposed_form.serializeArray(), function () {
params[this.name] = this.value;
});
href = href.split("?")[0] + "?" + $.param(params);
window.history.pushState(null, document.title, href);
});
});
});
}
// Attach behavior to pager, summary, facet links.
$("[data-drupal-pager-id], [data-drupal-facets-summary-id], [data-drupal-facet-id]")
.once()
.find("a:not(.facets-soft-limit-link)")
.click(function (e) {
// Let ctrl/cmd click open in a new window.
if (e.shiftKey || e.ctrlKey || e.metaKey) {
return;
}
e.preventDefault();
window.history.pushState(null, document.title, $(this).attr("href"));
});
// Trigger on sort change.
$('[data-drupal-pager-id] select[name="order"]')
.once()
.change(function () {
var href = window.location.href;
var params = Drupal.Views.parseQueryString(href);
var selection = $(this).val();
var option = $('option[value="' + selection + '"]');
params.sort_order = option.data("sort_order");
params.sort_by = option.data("sort_by");
href = href.split("?")[0] + "?" + $.param(params);
window.history.pushState(null, document.title, href);
});
},
};
})(jQuery, Drupal);

70
modules/islandora_advanced_search/js/facets/soft-limit.js

@ -0,0 +1,70 @@
//# sourceURL=modules/contrib/islandora/modules/islandora_advanced_search/js/facets/soft-limit.js
/**
* @file
* Overrides the soft-limit.js behavior from the 'facets' module.
* As when having many facets the original version causes the page to slow down and snap to hidden when rendering.
*/
(function ($) {
'use strict';
Drupal.behaviors.facetSoftLimit = {
attach: function (context, settings) {
if (settings.facets.softLimit !== 'undefined') {
$.each(settings.facets.softLimit, function (facet, limit) {
Drupal.facets.applySoftLimit(facet, limit, settings);
});
}
}
};
Drupal.facets = Drupal.facets || {};
/**
* Applies the soft limit UI feature to a specific facets list.
*
* @param {string} facet
* The facet id.
* @param {string} limit
* The maximum amount of items to show.
* @param {object} settings
* Settings.
*/
Drupal.facets.applySoftLimit = function (facet, limit, settings) {
var zero_based_limit = (limit - 1);
var facet_id = facet;
var facetsList = $('ul[data-drupal-facet-id="' + facet_id + '"]');
// In case of multiple instances of a facet, we need to key them.
if (facetsList.length > 1) {
facetsList.each(function (key, $value) {
$(this).attr('data-drupal-facet-id', facet_id + '-' + key);
});
}
// Add "Show more" / "Show less" links.
facetsList.filter(function () {
return $(this).next('ul').length == 1; // Has expanding list.
}).each(function () {
var facet = $(this);
var expand = facet.next('ul');
var link = expand.next('a');
var showLessLabel = settings.facets.softLimitSettings[facet_id].showLessLabel;
var showMoreLabel = settings.facets.softLimitSettings[facet_id].showMoreLabel;
link.text(showMoreLabel)
.once()
.on('click', function () {
if (!expand.is(":visible")) {
expand.slideDown();
$(this).addClass('open').text(showLessLabel);
}
else {
expand.slideUp();
$(this).removeClass('open').text(showMoreLabel);
}
return false;
})
});
};
})(jQuery);

2
modules/islandora_advanced_search/src/Form/AdvancedSearchForm.php

@ -71,7 +71,7 @@ class AdvancedSearchForm extends FormBase {
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('request_stack')->getMainRequest(),
$container->get('request_stack')->getMasterRequest(),
$container->get('current_route_match')
);
}

2
modules/islandora_advanced_search/src/Plugin/Block/AdvancedSearchBlock.php

@ -108,7 +108,7 @@ class AdvancedSearchBlock extends BlockBase implements ContainerFactoryPluginInt
$plugin_definition,
$container->get('plugin.manager.search_api.display'),
$container->get('form_builder'),
$container->get('request_stack')->getMainRequest()
$container->get('request_stack')->getMasterRequest()
);
}

2
modules/islandora_advanced_search/src/Plugin/Block/SearchResultsPagerBlock.php

@ -58,7 +58,7 @@ class SearchResultsPagerBlock extends BlockBase implements ContainerFactoryPlugi
$configuration,
$plugin_id,
$plugin_definition,
$container->get('request_stack')->getMainRequest()
$container->get('request_stack')->getMasterRequest()
);
}

6
modules/islandora_audio/CONTRIBUTING.md

@ -16,7 +16,7 @@ If you would like to submit a use case to the Islandora 8 project, please submit
### Documentation
You can contribute documentation in two different ways. One way is to create an issue [here](https://github.com/Islandora/documentation/issues/new), prepending "Documentation:" to the title of the issue. Another way is by pull request, which is the same process as [Contribute Code](https://github.com/Islandora/documentation/blob/main/CONTRIBUTING.md#contribute-code). All documentation resides in [`docs`](https://github.com/Islandora/documentation/tree/main/docs).
You can contribute documentation in two different ways. One way is to create an issue [here](https://github.com/Islandora/documentation/issues/new), prepending "Documentation:" to the title of the issue. Another way is by pull request, which is the same process as [Contribute Code](https://github.com/Islandora/documentation/blob/master/CONTRIBUTING.md#contribute-code). All documentation resides in [`docs`](https://github.com/Islandora/documentation/tree/master/docs).
### Request a new feature
@ -62,9 +62,9 @@ Contributions to the Islandora codebase should be sent as GitHub pull requests.
Take a look at [Creating a pull request](https://help.github.com/articles/creating-a-pull-request). In a nutshell you need to:
1. [Fork](https://help.github.com/articles/fork-a-repo) this repository to your personal or institutional GitHub account (depending on the CLA you are working under). Be cautious of which branches you work from though (you'll want to base your work off the default branch). See [Fork a repo](https://help.github.com/articles/fork-a-repo) for detailed instructions.
1. [Fork](https://help.github.com/articles/fork-a-repo) this repository to your personal or institutional GitHub account (depending on the CLA you are working under). Be cautious of which branches you work from though (you'll want to base your work off master, or for Drupal modules use the most recent version branch). See [Fork a repo](https://help.github.com/articles/fork-a-repo) for detailed instructions.
2. Commit any changes to your fork.
3. Send a [pull request](https://help.github.com/articles/creating-a-pull-request) using the [pull request template](https://github.com/Islandora/documentation/blob/main/.github/PULL_REQUEST_TEMPLATE.md) to the Islandora GitHub repository that you forked in step 1. If your pull request is related to an existing issue -- for instance, because you reported a [bug/issue](https://github.com/Islandora/documentation/issues) earlier -- prefix the title of your pull request with the corresponding issue number (e.g. `issue-123: ...`). Please also include a reference to the issue in the description of the pull. This can be done by using '#' plus the issue number like so '#123', also try to pick an appropriate name for the branch in which you're issuing the pull request from.
3. Send a [pull request](https://help.github.com/articles/creating-a-pull-request) using the [pull request template](https://github.com/Islandora/documentation/blob/master/.github/PULL_REQUEST_TEMPLATE.md) to the Islandora GitHub repository that you forked in step 1. If your pull request is related to an existing issue -- for instance, because you reported a [bug/issue](https://github.com/Islandora/documentation/issues) earlier -- prefix the title of your pull request with the corresponding issue number (e.g. `issue-123: ...`). Please also include a reference to the issue in the description of the pull. This can be done by using '#' plus the issue number like so '#123', also try to pick an appropriate name for the branch in which you're issuing the pull request from.
You may want to read [Syncing a fork](https://help.github.com/articles/syncing-a-fork) for instructions on how to keep your fork up to date with the latest changes of the upstream (official) repository.

4
modules/islandora_audio/README.md

@ -6,14 +6,14 @@
## Introduction
Provides actions to convert audio with a [Homarus](https://github.com/Islandora/Crayfish/tree/2.x/Homarus) (`ffmpeg`) server.
Provides actions to convert audio with a [Homarus](https://github.com/Islandora/Crayfish/tree/dev/Homarus) (`ffmpeg`) server.
## Requirements
- `islandora` and `islandora_core_feature`
- A Homarus microservice
- A message broker (e.g. Activemq) for Islandora 8
- An instance of `islandora-connector-derivative` (from [Alpaca](https://github.com/Islandora/Alpaca/tree/1.x/islandora-connector-derivative)) configured for Homarus
- An instance of `islandora-connector-derivative` (from [Alpaca](https://github.com/Islandora/Alpaca/tree/dev/islandora-connector-derivative)) configured for Homarus
## Installation

3
modules/islandora_audio/config/schema/islandora_audio.schema.yml

@ -29,6 +29,3 @@ action.configuration.generate_audio_derivative:
path:
type: text
label: 'File path with extension'
field.formatter.settings.islandora_file_audio:
type: field.formatter.settings.file_audio

3
modules/islandora_audio/islandora_audio.info.yml

@ -2,6 +2,7 @@ name: 'Islandora Audio'
description: 'Islandora audio derivative actions'
type: module
package: Islandora
core_version_requirement: ^9 || ^10
core: 8.x
core_version_requirement: ^8 || ^9
dependencies:
- drupal:islandora

2
modules/islandora_audio/js/audio.js

@ -23,10 +23,8 @@
initialized = true;
if ($('audio')[0].textTracks.length > 0) {
$('audio')[0].textTracks[0].oncuechange = function() {
if (this.activeCues.length > 0) {
var currentCue = this.activeCues[0].text;
$('#audioTrack').html(currentCue);
}
}
}
}

9
modules/islandora_audio/tests/src/Functional/GenerateAudioDerivativeTest.php

@ -40,7 +40,7 @@ class GenerateAudioDerivativeTest extends GenerateDerivativeTestBase {
// Create an action to generate a audio derivative.
$this->drupalGet('admin/config/system/actions');
$this->getSession()->getPage()->findById("edit-action")->selectOption("Generate a audio derivative");
$this->getSession()->getPage()->pressButton('Create');
$this->getSession()->getPage()->pressButton($this->t('Create'));
$this->assertSession()->statusCodeEquals(200);
$this->getSession()->getPage()->fillField('edit-label', "Generate audio test derivative");
@ -53,7 +53,7 @@ class GenerateAudioDerivativeTest extends GenerateDerivativeTestBase {
$this->getSession()->getPage()->fillField('edit-args', "-f mp3");
$this->getSession()->getPage()->fillField('edit-scheme', "public");
$this->getSession()->getPage()->fillField('edit-path', "derp.mov");
$this->getSession()->getPage()->pressButton('Save');
$this->getSession()->getPage()->pressButton($this->t('Save'));
$this->assertSession()->statusCodeEquals(200);
// Create a context and add the action as a derivative reaction.
@ -66,10 +66,9 @@ class GenerateAudioDerivativeTest extends GenerateDerivativeTestBase {
'name[0][value]' => 'Test Media',
'files[field_media_file_0]' => __DIR__ . '/../../fixtures/test_file.txt',
'field_media_of[0][target_id]' => 'Test Node',
'field_media_use[0][target_id]' => $this->preservationMasterTerm->label(),
'field_tags[0][target_id]' => 'Preservation Master',
];
$this->drupalGet('media/add/' . $this->testMediaType->id());
$this->submitForm($values, 'Save');
$this->drupalPostForm('media/add/' . $this->testMediaType->id(), $values, $this->t('Save'));
$expected = [
'source_uri' => 'test_file.txt',

6
modules/islandora_breadcrumbs/CONTRIBUTING.md

@ -16,7 +16,7 @@ If you would like to submit a use case to the Islandora 8 project, please submit
### Documentation
You can contribute documentation in two different ways. One way is to create an issue [here](https://github.com/Islandora/documentation/issues/new), prepending "Documentation:" to the title of the issue. Another way is by pull request, which is the same process as [Contribute Code](https://github.com/Islandora/documentation/blob/main/CONTRIBUTING.md#contribute-code). All documentation resides in [`docs`](https://github.com/Islandora/documentation/tree/main/docs).
You can contribute documentation in two different ways. One way is to create an issue [here](https://github.com/Islandora/documentation/issues/new), prepending "Documentation:" to the title of the issue. Another way is by pull request, which is the same process as [Contribute Code](https://github.com/Islandora/documentation/blob/master/CONTRIBUTING.md#contribute-code). All documentation resides in [`docs`](https://github.com/Islandora/documentation/tree/master/docs).
### Request a new feature
@ -62,9 +62,9 @@ Contributions to the Islandora codebase should be sent as GitHub pull requests.
Take a look at [Creating a pull request](https://help.github.com/articles/creating-a-pull-request). In a nutshell you need to:
1. [Fork](https://help.github.com/articles/fork-a-repo) this repository to your personal or institutional GitHub account (depending on the CLA you are working under). Be cautious of which branches you work from though (you'll want to base your work off the default branch). See [Fork a repo](https://help.github.com/articles/fork-a-repo) for detailed instructions.
1. [Fork](https://help.github.com/articles/fork-a-repo) this repository to your personal or institutional GitHub account (depending on the CLA you are working under). Be cautious of which branches you work from though (you'll want to base your work off master, or for Drupal modules use the most recent version branch). See [Fork a repo](https://help.github.com/articles/fork-a-repo) for detailed instructions.
2. Commit any changes to your fork.
3. Send a [pull request](https://help.github.com/articles/creating-a-pull-request) using the [pull request template](https://github.com/Islandora/documentation/blob/main/.github/PULL_REQUEST_TEMPLATE.md) to the Islandora GitHub repository that you forked in step 1. If your pull request is related to an existing issue -- for instance, because you reported a [bug/issue](https://github.com/Islandora/documentation/issues) earlier -- prefix the title of your pull request with the corresponding issue number (e.g. `issue-123: ...`). Please also include a reference to the issue in the description of the pull. This can be done by using '#' plus the issue number like so '#123', also try to pick an appropriate name for the branch in which you're issuing the pull request from.
3. Send a [pull request](https://help.github.com/articles/creating-a-pull-request) using the [pull request template](https://github.com/Islandora/documentation/blob/master/.github/PULL_REQUEST_TEMPLATE.md) to the Islandora GitHub repository that you forked in step 1. If your pull request is related to an existing issue -- for instance, because you reported a [bug/issue](https://github.com/Islandora/documentation/issues) earlier -- prefix the title of your pull request with the corresponding issue number (e.g. `issue-123: ...`). Please also include a reference to the issue in the description of the pull. This can be done by using '#' plus the issue number like so '#123', also try to pick an appropriate name for the branch in which you're issuing the pull request from.
You may want to read [Syncing a fork](https://help.github.com/articles/syncing-a-fork) for instructions on how to keep your fork up to date with the latest changes of the upstream (official) repository.

9
modules/islandora_breadcrumbs/config/install/islandora_breadcrumbs.breadcrumbs.yml

@ -1,4 +1,9 @@
maxDepth: -1
includeSelf: FALSE
referenceFields:
- field_member_of
referenceField: field_member_of
dependencies:
module:
- islandora
enforced:
module:
- islandora_breadcrumbs

9
modules/islandora_breadcrumbs/config/schema/islandora_breadcrumbs.schema.yml

@ -7,9 +7,6 @@ islandora_breadcrumbs.breadcrumbs:
includeSelf:
type: boolean
label: 'Include Self'
referenceFields:
type: sequence
label: 'Reference Fields'
sequence:
type: string
label: 'Reference Field'
referenceField:
type: string
label: 'Reference Field'

5
modules/islandora_breadcrumbs/islandora_breadcrumbs.info.yml

@ -1,7 +1,8 @@
name: 'Islandora Breadcrumbs'
type: module
description: 'Builds breadcrumbs based on field_member_of relationships.'
core_version_requirement: ^9 || ^10
core: 8.x
core_version_requirement: ^8 || ^9
package: Islandora
dependencies:
- islandora:islandora
- drupal:islandora

18
modules/islandora_breadcrumbs/islandora_breadcrumbs.install

@ -1,18 +0,0 @@
<?php
/**
* @file
* Install/update hook implementations.
*/
/**
* Update referenceField config to referenceFields.
*/
function islandora_breadcrumbs_update_8001() {
$config_factory = \Drupal::configFactory();
$config = $config_factory->getEditable('islandora_breadcrumbs.breadcrumbs');
$config->set('referenceFields', [$config->get('referenceField')]);
$config->clear('referenceField');
$config->save();
return "Updated referenceFields config.";
}

5
modules/islandora_breadcrumbs/islandora_breadcrumbs.links.menu.yml

@ -1,5 +0,0 @@
system.islandora_breadcrumbs_settings:
title: 'Breadcrumbs Settings'
parent: system.admin_config_islandora
route_name: system.islandora_breadcrumbs_settings
description: 'Configure Islandora breadcrumb settings'

7
modules/islandora_breadcrumbs/islandora_breadcrumbs.routing.yml

@ -1,7 +0,0 @@
system.islandora_breadcrumbs_settings:
path: '/admin/config/islandora/breadcrumbs'
defaults:
_form: 'Drupal\islandora_breadcrumbs\Form\IslandoraBreadcrumbsSettingsForm'
_title: 'Islandora Breadcrumbs Settings'
requirements:
_permission: 'administer site configuration'

2
modules/islandora_breadcrumbs/islandora_breadcrumbs.services.yml

@ -1,6 +1,6 @@
services:
islandora_breadcrumbs.breadcrumb:
class: Drupal\islandora_breadcrumbs\IslandoraBreadcrumbBuilder
arguments: ['@entity_type.manager', '@config.factory', '@islandora.utils']
arguments: ['@entity_type.manager', '@config.factory']
tags:
- { name: breadcrumb_builder, priority: 100 }

132
modules/islandora_breadcrumbs/src/Form/IslandoraBreadcrumbsSettingsForm.php

@ -1,132 +0,0 @@
<?php
namespace Drupal\islandora_breadcrumbs\Form;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Configure islandora_breadcrumbs settings.
*/
class IslandoraBreadcrumbsSettingsForm extends ConfigFormBase {
/**
* Config settings.
*
* @var string
*/
const SETTINGS = 'islandora_breadcrumbs.breadcrumbs';
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'islandora_breadcrumbs_settings';
}
/**
* {@inheritdoc}
*/
protected function getEditableConfigNames() {
return [
static::SETTINGS,
];
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this->config(static::SETTINGS);
$form['maxDepth'] = [
'#type' => 'number',
'#default_value' => $config->get('maxDepth'),
'#min' => -1,
'#step' => 1,
'#title' => $this->t('Maximum number of ancestor breadcrumbs'),
'#description' => $this->t("Stops adding ancestor references when the chain reaches this number. The count does not include the current node when enabled. The default value, '-1' disables this feature."),
];
$form['includeSelf'] = [
'#type' => 'checkbox',
'#title' => $this->t('Include the current node in the breadcrumbs?'),
'#default_value' => $config->get('includeSelf'),
];
// Using the textarea instead of a select so the site maintainer can
// provide an ordered list of items rather than simply selecting from a
// list which enforces it's own order.
$form['referenceFields'] = [
'#type' => 'textarea',
'#title' => $this->t('Entity Reference fields to follow'),
'#default_value' => implode("\n", $config->get('referenceFields')),
'#description' => $this->t("Entity Reference field machine names to follow when building the breadcrumbs.<br>One per line.<br>Valid options: @options",
[
"@options" => implode(", ", static::getNodeEntityReferenceFields()),
]
),
'#element_validate' => [[get_class($this), 'validateReferenceFields']],
];
return parent::buildForm($form, $form_state);
}
/**
* Returns a list of node entity reference field machine names.
*
* We use this for building the form field description and for
* validating the reference fields value.
*/
protected static function getNodeEntityReferenceFields() {
return array_keys(\Drupal::service('entity_field.manager')->getFieldMapByFieldType('entity_reference')['node']);
}
/**
* Turns a text area into an array of values.
*
* Used for validating the field reference text area
* and saving the form state.
*/
protected static function textToArray($string) {
return array_filter(array_map('trim', explode("\n", $string)), 'strlen');
}
/**
* Callback for settings form.
*
* @param array $element
* An associative array containing the properties and children of the
* generic form element.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form for the form this element belongs to.
*
* @see \Drupal\Core\Render\Element\FormElement::processPattern()
*/
public static function validateReferenceFields(array $element, FormStateInterface $form_state) {
$valid_fields = static::getNodeEntityReferenceFields();
foreach (static::textToArray($element['#value']) as $value) {
if (!in_array($value, $valid_fields)) {
$form_state->setError($element, t('"@field" is not a valid entity reference field!', ["@field" => $value]));
}
}
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->configFactory->getEditable(static::SETTINGS)
->set('referenceFields', static::textToArray($form_state->getValue('referenceFields')))
->set('maxDepth', $form_state->getValue('maxDepth'))
->set('includeSelf', $form_state->getValue('includeSelf'))
->save();
parent::submitForm($form, $form_state);
}
}

69
modules/islandora_breadcrumbs/src/IslandoraBreadcrumbBuilder.php

@ -4,12 +4,12 @@ namespace Drupal\islandora_breadcrumbs;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Breadcrumb\Breadcrumb;
use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface;
use Drupal\Core\Link;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\islandora\IslandoraUtils;
/**
* Provides breadcrumbs for nodes using a configured entity reference field.
@ -31,13 +31,6 @@ class IslandoraBreadcrumbBuilder implements BreadcrumbBuilderInterface {
*/
protected $nodeStorage;
/**
* Islandora utils.
*
* @var \Drupal\islandora\IslandoraUtils
*/
protected $utils;
/**
* Constructs a breadcrumb builder.
*
@ -45,13 +38,10 @@ class IslandoraBreadcrumbBuilder implements BreadcrumbBuilderInterface {
* Storage to load nodes.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The configuration factory.
* @param \Drupal\islandora\IslandoraUtils $utils
* Islandora utils service.
*/
public function __construct(EntityTypeManagerInterface $entity_manager, ConfigFactoryInterface $config_factory, IslandoraUtils $utils) {
public function __construct(EntityTypeManagerInterface $entity_manager, ConfigFactoryInterface $config_factory) {
$this->nodeStorage = $entity_manager->getStorage('node');
$this->config = $config_factory->get('islandora_breadcrumbs.breadcrumbs');
$this->utils = $utils;
}
/**
@ -64,14 +54,7 @@ class IslandoraBreadcrumbBuilder implements BreadcrumbBuilderInterface {
$nid = $attributes->getRawParameters()->get('node');
if (!empty($nid)) {
$node = $this->nodeStorage->load($nid);
if (empty($node)) {
return FALSE;
}
foreach ($this->config->get('referenceFields') as $field) {
if ($node->hasField($field)) {
return TRUE;
}
}
return (!empty($node) && $node->hasField($this->config->get('referenceField')));
}
}
@ -83,29 +66,51 @@ class IslandoraBreadcrumbBuilder implements BreadcrumbBuilderInterface {
$nid = $route_match->getRawParameters()->get('node');
$node = $this->nodeStorage->load($nid);
$breadcrumb = new Breadcrumb();
$breadcrumb->addCacheableDependency($this->config);
$breadcrumb->addLink(Link::createFromRoute($this->t('Home'), '<front>'));
$chain = array_reverse($this->utils->findAncestors($node, $this->config->get('referenceFields'), $this->config->get('maxDepth')));
$chain = [];
$this->walkMembership($node, $chain);
// XXX: Handle a looping breadcrumb scenario by filtering the present
// node out and then optionally re-adding it after if set to do so.
$chain = array_filter($chain, function ($link) use ($nid) {
return $link !== $nid;
});
if ($this->config->get('includeSelf')) {
array_push($chain, $nid);
if (!$this->config->get('includeSelf')) {
array_pop($chain);
}
$breadcrumb->addCacheableDependency($node);
// Add membership chain to the breadcrumb.
foreach ($chain as $chainlink) {
$node = $this->nodeStorage->load($chainlink);
$breadcrumb->addCacheableDependency($node);
$breadcrumb->addLink($node->toLink());
$breadcrumb->addCacheableDependency($chainlink);
$breadcrumb->addLink($chainlink->toLink());
}
$breadcrumb->addCacheContexts(['route']);
return $breadcrumb;
}
/**
* Follows chain of field_member_of links.
*
* We pass crumbs by reference to enable checking for looped chains.
*/
protected function walkMembership(EntityInterface $entity, &$crumbs) {
// Avoid infinate loops, return if we've seen this before.
foreach ($crumbs as $crumb) {
if ($crumb->uuid == $entity->uuid) {
return;
}
}
// Add this item onto the pile.
array_unshift($crumbs, $entity);
if ($this->config->get('maxDepth') > 0 && count($crumbs) >= $this->config->get('maxDepth')) {
return;
}
// Find the next in the chain, if there are any.
if ($entity->hasField($this->config->get('referenceField')) &&
!$entity->get($this->config->get('referenceField'))->isEmpty() &&
$entity->get($this->config->get('referenceField'))->entity instanceof EntityInterface) {
$this->walkMembership($entity->get($this->config->get('referenceField'))->entity, $crumbs);
}
}
}

4
modules/islandora_breadcrumbs/tests/src/Functional/BreadcrumbsTest.php

@ -20,7 +20,7 @@ class BreadcrumbsTest extends IslandoraFunctionalTestBase {
*
* @var array
*/
protected static $modules = [
public static $modules = [
'islandora_breadcrumbs',
];
@ -56,7 +56,7 @@ class BreadcrumbsTest extends IslandoraFunctionalTestBase {
/**
* {@inheritdoc}
*/
public function setUp(): void {
public function setUp() {
parent::setUp();
// Create some nodes.

6
modules/islandora_core_feature/CONTRIBUTING.md

@ -16,7 +16,7 @@ If you would like to submit a use case to the Islandora 8 project, please submit
### Documentation
You can contribute documentation in two different ways. One way is to create an issue [here](https://github.com/Islandora/documentation/issues/new), prepending "Documentation:" to the title of the issue. Another way is by pull request, which is the same process as [Contribute Code](https://github.com/Islandora/documentation/blob/main/CONTRIBUTING.md#contribute-code). All documentation resides in [`docs`](https://github.com/Islandora/documentation/tree/main/docs).
You can contribute documentation in two different ways. One way is to create an issue [here](https://github.com/Islandora/documentation/issues/new), prepending "Documentation:" to the title of the issue. Another way is by pull request, which is the same process as [Contribute Code](https://github.com/Islandora/documentation/blob/master/CONTRIBUTING.md#contribute-code). All documentation resides in [`docs`](https://github.com/Islandora/documentation/tree/master/docs).
### Request a new feature
@ -62,9 +62,9 @@ Contributions to the Islandora codebase should be sent as GitHub pull requests.
Take a look at [Creating a pull request](https://help.github.com/articles/creating-a-pull-request). In a nutshell you need to:
1. [Fork](https://help.github.com/articles/fork-a-repo) this repository to your personal or institutional GitHub account (depending on the CLA you are working under). Be cautious of which branches you work from though (you'll want to base your work off the default branch). See [Fork a repo](https://help.github.com/articles/fork-a-repo) for detailed instructions.
1. [Fork](https://help.github.com/articles/fork-a-repo) this repository to your personal or institutional GitHub account (depending on the CLA you are working under). Be cautious of which branches you work from though (you'll want to base your work off master, or for Drupal modules use the most recent version branch). See [Fork a repo](https://help.github.com/articles/fork-a-repo) for detailed instructions.
2. Commit any changes to your fork.
3. Send a [pull request](https://help.github.com/articles/creating-a-pull-request) using the [pull request template](https://github.com/Islandora/documentation/blob/main/.github/PULL_REQUEST_TEMPLATE.md) to the Islandora GitHub repository that you forked in step 1. If your pull request is related to an existing issue -- for instance, because you reported a [bug/issue](https://github.com/Islandora/documentation/issues) earlier -- prefix the title of your pull request with the corresponding issue number (e.g. `issue-123: ...`). Please also include a reference to the issue in the description of the pull. This can be done by using '#' plus the issue number like so '#123', also try to pick an appropriate name for the branch in which you're issuing the pull request from.
3. Send a [pull request](https://help.github.com/articles/creating-a-pull-request) using the [pull request template](https://github.com/Islandora/documentation/blob/master/.github/PULL_REQUEST_TEMPLATE.md) to the Islandora GitHub repository that you forked in step 1. If your pull request is related to an existing issue -- for instance, because you reported a [bug/issue](https://github.com/Islandora/documentation/issues) earlier -- prefix the title of your pull request with the corresponding issue number (e.g. `issue-123: ...`). Please also include a reference to the issue in the description of the pull. This can be done by using '#' plus the issue number like so '#123', also try to pick an appropriate name for the branch in which you're issuing the pull request from.
You may want to read [Syncing a fork](https://help.github.com/articles/syncing-a-fork) for instructions on how to keep your fork up to date with the latest changes of the upstream (official) repository.

0
modules/islandora_core_feature/config/optional/core.entity_view_mode.media.source.yml → modules/islandora_core_feature/config/install/core.entity_view_mode.media.source.yml

100
modules/islandora_core_feature/config/install/features.bundle.islandora.yml

@ -0,0 +1,100 @@
langcode: en
status: true
dependencies:
enforced:
module:
- islandora_core_feature
name: Islandora
machine_name: islandora
description: 'Features for islandora'
assignments:
alter:
core: true
uuid: true
user_permissions: true
enabled: true
weight: 0
base:
types:
config:
comment_type: comment_type
node_type: node_type
content:
user: user
enabled: true
weight: -2
core:
types:
config:
date_format: date_format
field_storage_config: field_storage_config
entity_form_mode: entity_form_mode
image_style: image_style
menu: menu
responsive_image_style: responsive_image_style
user_role: user_role
entity_view_mode: entity_view_mode
enabled: true
weight: 5
dependency:
enabled: true
weight: 15
exclude:
types:
config:
features_bundle: features_bundle
curated: true
module:
installed: true
profile: true
namespace: true
namespace_any: false
enabled: true
weight: -5
existing:
enabled: true
weight: 12
forward_dependency:
enabled: true
weight: 4
namespace:
enabled: true
weight: 0
optional:
types:
config: { }
enabled: true
weight: 0
packages:
enabled: true
weight: -20
profile:
curated: true
standard:
files: true
dependencies: true
types:
config:
block: block
language_content_settings: language_content_settings
configurable_language: configurable_language
migration: migration
shortcut_set: shortcut_set
tour: tour
enabled: true
weight: 10
site:
types:
config:
action: action
contact_form: contact_form
block_content_type: block_content_type
rdf_mapping: rdf_mapping
search_page: search_page
taxonomy_vocabulary: taxonomy_vocabulary
editor: editor
filter_format: filter_format
enabled: true
weight: 7
profile_name: ''
is_profile: false

0
modules/islandora_core_feature/config/optional/field.field.taxonomy_term.islandora_media_use.field_external_uri.yml → modules/islandora_core_feature/config/install/field.field.taxonomy_term.islandora_media_use.field_external_uri.yml

0
modules/islandora_core_feature/config/optional/field.field.taxonomy_term.islandora_models.field_external_uri.yml → modules/islandora_core_feature/config/install/field.field.taxonomy_term.islandora_models.field_external_uri.yml

0
modules/islandora_core_feature/config/optional/field.storage.media.field_file_size.yml → modules/islandora_core_feature/config/install/field.storage.media.field_file_size.yml

0
modules/islandora_core_feature/config/optional/field.storage.media.field_height.yml → modules/islandora_core_feature/config/install/field.storage.media.field_height.yml

0
modules/islandora_core_feature/config/optional/field.storage.media.field_media_audio_file.yml → modules/islandora_core_feature/config/install/field.storage.media.field_media_audio_file.yml

0
modules/islandora_core_feature/config/optional/field.storage.media.field_media_document.yml → modules/islandora_core_feature/config/install/field.storage.media.field_media_document.yml

0
modules/islandora_core_feature/config/optional/field.storage.media.field_media_file.yml → modules/islandora_core_feature/config/install/field.storage.media.field_media_file.yml

0
modules/islandora_core_feature/config/optional/field.storage.media.field_media_image.yml → modules/islandora_core_feature/config/install/field.storage.media.field_media_image.yml

0
modules/islandora_core_feature/config/optional/field.storage.media.field_media_of.yml → modules/islandora_core_feature/config/install/field.storage.media.field_media_of.yml

0
modules/islandora_core_feature/config/optional/field.storage.media.field_media_use.yml → modules/islandora_core_feature/config/install/field.storage.media.field_media_use.yml

0
modules/islandora_core_feature/config/optional/field.storage.media.field_media_video_file.yml → modules/islandora_core_feature/config/install/field.storage.media.field_media_video_file.yml

0
modules/islandora_core_feature/config/optional/field.storage.media.field_mime_type.yml → modules/islandora_core_feature/config/install/field.storage.media.field_mime_type.yml

0
modules/islandora_core_feature/config/optional/field.storage.media.field_original_name.yml → modules/islandora_core_feature/config/install/field.storage.media.field_original_name.yml

0
modules/islandora_core_feature/config/optional/field.storage.media.field_width.yml → modules/islandora_core_feature/config/install/field.storage.media.field_width.yml

0
modules/islandora_core_feature/config/optional/field.storage.node.field_member_of.yml → modules/islandora_core_feature/config/install/field.storage.node.field_member_of.yml

0
modules/islandora_core_feature/config/optional/field.storage.node.field_model.yml → modules/islandora_core_feature/config/install/field.storage.node.field_model.yml

4
modules/islandora_core_feature/config/optional/field.storage.node.field_weight.yml → modules/islandora_core_feature/config/install/field.storage.node.field_weight.yml

@ -14,8 +14,6 @@ module: core
locked: false
cardinality: 1
translatable: true
indexes:
value:
- value
indexes: { }
persist_with_no_fields: false
custom_storage: false

0
modules/islandora_core_feature/config/optional/field.storage.taxonomy_term.field_external_uri.yml → modules/islandora_core_feature/config/install/field.storage.taxonomy_term.field_external_uri.yml

5
modules/islandora_core_feature/config/install/filehash.settings.yml

@ -0,0 +1,5 @@
algos:
sha1: sha1
md5: '0'
sha256: '0'
dedupe: false

0
modules/islandora_core_feature/config/optional/migrate_plus.migration.islandora_tags.yml → modules/islandora_core_feature/config/install/migrate_plus.migration.islandora_tags.yml

0
modules/islandora_core_feature/config/optional/migrate_plus.migration_group.islandora.yml → modules/islandora_core_feature/config/install/migrate_plus.migration_group.islandora.yml

0
modules/islandora_core_feature/config/optional/rest.resource.entity.file.yml → modules/islandora_core_feature/config/install/rest.resource.entity.file.yml

0
modules/islandora_core_feature/config/optional/rest.resource.entity.media.yml → modules/islandora_core_feature/config/install/rest.resource.entity.media.yml

0
modules/islandora_core_feature/config/optional/rest.resource.entity.node.yml → modules/islandora_core_feature/config/install/rest.resource.entity.node.yml

0
modules/islandora_core_feature/config/optional/rest.resource.entity.taxonomy_term.yml → modules/islandora_core_feature/config/install/rest.resource.entity.taxonomy_term.yml

0
modules/islandora_core_feature/config/optional/system.action.delete_file_as_fedora_external_content.yml → modules/islandora_core_feature/config/install/system.action.delete_file_as_fedora_external_content.yml

0
modules/islandora_core_feature/config/optional/system.action.delete_media_from_triplestore.yml → modules/islandora_core_feature/config/install/system.action.delete_media_from_triplestore.yml

0
modules/islandora_core_feature/config/optional/system.action.delete_node_from_fedora.yml → modules/islandora_core_feature/config/install/system.action.delete_node_from_fedora.yml

0
modules/islandora_core_feature/config/optional/system.action.delete_node_from_triplestore.yml → modules/islandora_core_feature/config/install/system.action.delete_node_from_triplestore.yml

0
modules/islandora_core_feature/config/optional/system.action.delete_taxonomy_term_in_fedora.yml → modules/islandora_core_feature/config/install/system.action.delete_taxonomy_term_in_fedora.yml

0
modules/islandora_core_feature/config/optional/system.action.delete_taxonomy_term_in_triplestore.yml → modules/islandora_core_feature/config/install/system.action.delete_taxonomy_term_in_triplestore.yml

0
modules/islandora_core_feature/config/optional/system.action.index_file_as_fedora_external_content.yml → modules/islandora_core_feature/config/install/system.action.index_file_as_fedora_external_content.yml

0
modules/islandora_core_feature/config/optional/system.action.index_media_in_fedora.yml → modules/islandora_core_feature/config/install/system.action.index_media_in_fedora.yml

0
modules/islandora_core_feature/config/optional/system.action.index_media_in_triplestore.yml → modules/islandora_core_feature/config/install/system.action.index_media_in_triplestore.yml

0
modules/islandora_core_feature/config/optional/system.action.index_node_in_fedora.yml → modules/islandora_core_feature/config/install/system.action.index_node_in_fedora.yml

0
modules/islandora_core_feature/config/optional/system.action.index_node_in_triplestore.yml → modules/islandora_core_feature/config/install/system.action.index_node_in_triplestore.yml

0
modules/islandora_core_feature/config/optional/system.action.index_taxonomy_term_in_fedora.yml → modules/islandora_core_feature/config/install/system.action.index_taxonomy_term_in_fedora.yml

0
modules/islandora_core_feature/config/optional/system.action.index_taxonomy_term_in_the_triplestore.yml → modules/islandora_core_feature/config/install/system.action.index_taxonomy_term_in_the_triplestore.yml

0
modules/islandora_core_feature/config/optional/taxonomy.vocabulary.islandora_media_use.yml → modules/islandora_core_feature/config/install/taxonomy.vocabulary.islandora_media_use.yml

0
modules/islandora_core_feature/config/optional/taxonomy.vocabulary.islandora_models.yml → modules/islandora_core_feature/config/install/taxonomy.vocabulary.islandora_models.yml

1
modules/islandora_core_feature/config/optional/views.view.all_taxonomy_terms.yml → modules/islandora_core_feature/config/install/views.view.all_taxonomy_terms.yml

@ -168,3 +168,4 @@ display:
- url.query_args
- user.permissions
tags: { }

0
modules/islandora_core_feature/config/optional/views.view.display_media.yml → modules/islandora_core_feature/config/install/views.view.display_media.yml

237
modules/islandora_core_feature/config/optional/views.view.file_checksum.yml → modules/islandora_core_feature/config/install/views.view.file_checksum.yml

@ -1,15 +1,14 @@
langcode: en
status: true
dependencies:
enforced:
module:
- islandora_core_feature
module:
- file
- filehash
- rest
- serialization
- user
enforced:
module:
- islandora_core_feature
id: file_checksum
label: 'File Checksum'
module: views
@ -17,24 +16,71 @@ description: 'Exposes a REST endpoint for getting the checksum of a File'
tag: ''
base_table: file_managed
base_field: fid
core: 8.x
display:
default:
display_plugin: default
id: default
display_title: Master
display_plugin: default
position: 0
display_options:
access:
type: none
options: { }
cache:
type: tag
options: { }
query:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
replica: false
query_comment: ''
query_tags: { }
exposed_form:
type: basic
options:
submit_button: Apply
reset_button: false
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
pager:
type: mini
options:
items_per_page: 10
offset: 0
id: 0
total_pages: null
expose:
items_per_page: false
items_per_page_label: 'Items per page'
items_per_page_options: '5, 10, 25, 50'
items_per_page_options_all: false
items_per_page_options_all_label: '- All -'
offset: false
offset_label: Offset
tags:
previous: ‹‹
next: ››
style:
type: serializer
row:
type: 'entity:file'
options:
relationship: none
view_mode: default
fields:
sha1:
id: sha1
table: file_managed
table: filehash
field: sha1
relationship: none
group_type: group
admin_label: ''
entity_type: file
entity_field: sha1
plugin_id: field
label: ''
exclude: false
alter:
@ -46,7 +92,7 @@ display:
external: false
replace_spaces: false
path_case: none
trim_whitespace: true
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
@ -60,7 +106,7 @@ display:
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: true
strip_tags: false
trim: false
preserve_tags: ''
html: false
@ -76,120 +122,13 @@ display:
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: filehash
settings: { }
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
original_sha1:
id: original_sha1
table: file_managed
field: original_sha1
relationship: none
group_type: group
admin_label: ''
entity_type: file
entity_field: original_sha1
plugin_id: field
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: true
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: true
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: false
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: filehash
settings: { }
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
pager:
type: mini
options:
offset: 0
items_per_page: 10
total_pages: null
id: 0
tags:
next: ››
previous: ‹‹
expose:
items_per_page: false
items_per_page_label: 'Items per page'
items_per_page_options: '5, 10, 25, 50'
items_per_page_options_all: false
items_per_page_options_all_label: '- All -'
offset: false
offset_label: Offset
exposed_form:
type: basic
options:
submit_button: Apply
reset_button: false
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
access:
type: perm
options:
perm: 'view checksums'
cache:
type: tag
options: { }
empty: { }
plugin_id: standard
filters: { }
sorts: { }
header: { }
footer: { }
empty: { }
relationships: { }
arguments:
fid:
id: fid
@ -198,9 +137,6 @@ display:
relationship: none
group_type: group
admin_label: ''
entity_type: file
entity_field: fid
plugin_id: file_fid
default_action: 'not found'
exception:
value: all
@ -215,8 +151,8 @@ display:
summary_options:
base_path: ''
count: true
override: false
items_per_page: 25
override: false
summary:
sort_order: asc
number_of_records: 0
@ -228,47 +164,31 @@ display:
validate_options: { }
break_phrase: false
not: false
filters: { }
style:
type: serializer
row:
type: 'entity:file'
options:
relationship: none
view_mode: default
query:
type: views_query
options:
query_comment: ''
disable_sql_rewrite: false
distinct: false
replica: false
query_tags: { }
relationships: { }
header: { }
footer: { }
entity_type: file
entity_field: fid
plugin_id: file_fid
display_extenders: { }
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- request_format
- url
- url.query_args
- user.permissions
tags: { }
rest_export_1:
display_plugin: rest_export
id: rest_export_1
display_title: 'REST export'
display_plugin: rest_export
position: 1
display_options:
display_extenders: { }
path: checksum/%file
pager:
type: some
options:
offset: 0
items_per_page: 10
offset: 0
style:
type: serializer
options:
@ -278,19 +198,6 @@ display:
type: data_field
options:
field_options: { }
display_extenders:
matomo:
enabled: false
keyword_gets: ''
keyword_behavior: first
keyword_concat_separator: ' '
category_behavior: none
category_gets: ''
category_concat_separator: ' '
category_fallback: ''
category_facets: { }
category_facets_concat_separator: ', '
path: checksum/%file
auth:
- basic_auth
- jwt_auth
@ -298,9 +205,7 @@ display:
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- request_format
- url
- user.permissions
tags: { }

182
modules/islandora_core_feature/config/optional/views.view.manage_members.yml → modules/islandora_core_feature/config/install/views.view.manage_members.yml

@ -1,17 +1,15 @@
langcode: en
status: true
dependencies:
enforced:
module:
- islandora_core_feature
module:
- jsonld
- node
- rest
- serialization
- user
enforced:
module:
- islandora_core_feature
_core:
default_config_hash: Zwu8JUsBiYaxPko_9DbJJhA-ZZSGOm81I9XtT9NH3M4
id: manage_members
label: 'Manage members'
module: views
@ -19,14 +17,61 @@ description: 'Manage members belonging to a piece of content'
tag: ''
base_table: node_field_data
base_field: nid
core: 8.x
display:
default:
display_plugin: default
id: default
display_title: Master
display_plugin: default
position: 0
display_options:
title: 'Manage members'
access:
type: perm
options:
perm: 'manage members'
cache:
type: tag
options: { }
query:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
replica: false
query_comment: ''
query_tags: { }
exposed_form:
type: basic
options:
submit_button: Apply
reset_button: false
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
pager:
type: mini
options:
items_per_page: 10
offset: 0
id: 0
total_pages: null
expose:
items_per_page: false
items_per_page_label: 'Items per page'
items_per_page_options: '5, 10, 25, 50'
items_per_page_options_all: false
items_per_page_options_all_label: '- All -'
offset: false
offset_label: Offset
tags:
previous: ‹‹
next: ››
style:
type: table
row:
type: fields
fields:
node_bulk_form:
id: node_bulk_form
@ -35,8 +80,6 @@ display:
relationship: none
group_type: group
admin_label: ''
entity_type: node
plugin_id: node_bulk_form
label: 'Node operations bulk form'
exclude: false
alter:
@ -81,27 +124,33 @@ display:
action_title: Action
include_exclude: exclude
selected_actions: { }
entity_type: node
plugin_id: node_bulk_form
title:
id: title
table: node_field_data
field: title
relationship: none
group_type: group
admin_label: ''
entity_type: node
entity_field: title
plugin_id: field
label: Title
exclude: false
alter:
alter_text: false
make_link: false
absolute: false
trim: false
word_boundary: false
ellipsis: false
strip_tags: false
trim: false
html: false
hide_empty: false
empty_zero: false
settings:
link_to_entity: true
plugin_id: field
relationship: none
group_type: group
admin_label: ''
label: Title
exclude: false
element_type: ''
element_class: ''
element_label_type: ''
@ -111,13 +160,9 @@ display:
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: string
settings:
link_to_entity: true
group_column: value
group_columns: { }
group_rows: true
@ -135,8 +180,6 @@ display:
relationship: none
group_type: group
admin_label: ''
entity_type: node
plugin_id: entity_operations
label: 'Operations links'
exclude: false
alter:
@ -179,56 +222,15 @@ display:
empty_zero: false
hide_alter_empty: true
destination: false
pager:
type: mini
options:
offset: 0
items_per_page: 10
total_pages: null
id: 0
tags:
next: ››
previous: ‹‹
expose:
items_per_page: false
items_per_page_label: 'Items per page'
items_per_page_options: '5, 10, 25, 50'
items_per_page_options_all: false
items_per_page_options_all_label: '- All -'
offset: false
offset_label: Offset
exposed_form:
type: basic
options:
submit_button: Apply
reset_button: false
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
access:
type: perm
options:
perm: 'manage members'
cache:
type: tag
options: { }
entity_type: node
plugin_id: entity_operations
filters: { }
sorts: { }
title: 'Manage members'
header: { }
footer: { }
empty: { }
sorts:
field_weight_value:
id: field_weight_value
table: node__field_weight
field: field_weight_value
relationship: none
group_type: group
admin_label: ''
plugin_id: standard
order: ASC
expose:
label: ''
field_identifier: ''
exposed: false
relationships: { }
arguments:
field_member_of_target_id:
id: field_member_of_target_id
@ -237,7 +239,6 @@ display:
relationship: none
group_type: group
admin_label: ''
plugin_id: numeric
default_action: default
exception:
value: all
@ -251,8 +252,8 @@ display:
summary_options:
base_path: ''
count: true
override: false
items_per_page: 25
override: false
summary:
sort_order: asc
number_of_records: 0
@ -262,32 +263,17 @@ display:
type: 'entity:node'
fail: 'not found'
validate_options:
bundles: { }
access: false
operation: view
multiple: 0
bundles: { }
access: false
break_phrase: false
not: false
filters: { }
plugin_id: numeric
display_extenders: { }
filter_groups:
operator: AND
groups: { }
style:
type: table
row:
type: fields
query:
type: views_query
options:
query_comment: ''
disable_sql_rewrite: false
distinct: false
replica: false
query_tags: { }
relationships: { }
header: { }
footer: { }
display_extenders: { }
cache_metadata:
max-age: 0
contexts:
@ -299,9 +285,9 @@ display:
- user.permissions
tags: { }
page_1:
display_plugin: page
id: page_1
display_title: Page
display_plugin: page
position: 1
display_options:
display_extenders: { }
@ -310,11 +296,11 @@ display:
type: tab
title: Children
description: ''
weight: 0
expanded: false
menu_name: main
parent: ''
weight: 0
context: '0'
menu_name: main
cache_metadata:
max-age: 0
contexts:
@ -326,11 +312,13 @@ display:
- user.permissions
tags: { }
rest_export_1:
display_plugin: rest_export
id: rest_export_1
display_title: 'REST export'
display_plugin: rest_export
position: 1
display_options:
display_extenders: { }
path: node/%node/members
style:
type: serializer
options:
@ -338,8 +326,6 @@ display:
formats:
jsonld: jsonld
json: json
display_extenders: { }
path: node/%node/members
auth:
- basic_auth
- jwt_auth

0
modules/islandora_core_feature/config/optional/views.view.media_of.yml → modules/islandora_core_feature/config/install/views.view.media_of.yml

1
modules/islandora_core_feature/config/optional/views.view.non_fedora_files.yml → modules/islandora_core_feature/config/install/views.view.non_fedora_files.yml

@ -194,3 +194,4 @@ display:
- url.query_args
- user.permissions
tags: { }

0
modules/islandora_core_feature/config/optional/views.view.reorder_children.yml → modules/islandora_core_feature/config/install/views.view.reorder_children.yml

24
modules/islandora_core_feature/config/optional/filehash.settings.yml

@ -1,24 +0,0 @@
algos:
blake2b_128: '0'
blake2b_160: '0'
blake2b_224: '0'
blake2b_256: '0'
blake2b_384: '0'
blake2b_512: '0'
md5: '0'
sha1: sha1
sha224: '0'
sha256: '0'
sha384: '0'
sha512_224: '0'
sha512_256: '0'
sha512: '0'
sha3_224: '0'
sha3_256: '0'
sha3_384: '0'
sha3_512: '0'
dedupe: 0
rehash: true
original: true
dedupe_original: false
mime_types: { }

16
modules/islandora_core_feature/islandora_core_feature.features.yml

@ -0,0 +1,16 @@
bundle: islandora
excluded:
- language.content_settings.taxonomy_term.islandora_media_use
- language.content_settings.taxonomy_term.islandora_models
required:
- features.bundle.islandora
- field.storage.media.field_file_size
- field.storage.media.field_height
- field.storage.media.field_media_of
- field.storage.media.field_media_use
- field.storage.media.field_mime_type
- field.storage.media.field_width
- field.storage.node.field_member_of
- field.storage.node.field_model
- field.storage.node.field_weight
- field.storage.taxonomy_term.field_external_uri

4
modules/islandora_core_feature/islandora_core_feature.info.yml

@ -1,11 +1,13 @@
name: 'Islandora Core Feature'
description: 'Minimum configuration required for Islandora.'
type: module
core_version_requirement: ^9 || ^10
core: 8.x
core_version_requirement: ^8 || ^9
dependencies:
- drupal:basic_auth
- drupal:content_translation
- drupal:eva
- drupal:features
- drupal:field
- drupal:file
- drupal:filehash

20
modules/islandora_core_feature/islandora_core_feature.post_update.php

@ -1,20 +0,0 @@
<?php
/**
* @file
* Post-update hooks.
*/
/**
* Add index to field_weight.
*/
function islandora_core_feature_post_update_add_index_to_field_weight() {
$storage = \Drupal::entityTypeManager()->getStorage('field_storage_config');
$field = $storage->load('node.field_weight');
$indexes = $field->getIndexes();
$indexes += [
'value' => ['value'],
];
$field->setIndexes($indexes);
$field->save();
}

6
modules/islandora_iiif/CONTRIBUTING.md

@ -16,7 +16,7 @@ If you would like to submit a use case to the Islandora 8 project, please submit
### Documentation
You can contribute documentation in two different ways. One way is to create an issue [here](https://github.com/Islandora/documentation/issues/new), prepending "Documentation:" to the title of the issue. Another way is by pull request, which is the same process as [Contribute Code](https://github.com/Islandora/documentation/blob/main/CONTRIBUTING.md#contribute-code). All documentation resides in [`docs`](https://github.com/Islandora/documentation/tree/main/docs).
You can contribute documentation in two different ways. One way is to create an issue [here](https://github.com/Islandora/documentation/issues/new), prepending "Documentation:" to the title of the issue. Another way is by pull request, which is the same process as [Contribute Code](https://github.com/Islandora/documentation/blob/master/CONTRIBUTING.md#contribute-code). All documentation resides in [`docs`](https://github.com/Islandora/documentation/tree/master/docs).
### Request a new feature
@ -62,9 +62,9 @@ Contributions to the Islandora codebase should be sent as GitHub pull requests.
Take a look at [Creating a pull request](https://help.github.com/articles/creating-a-pull-request). In a nutshell you need to:
1. [Fork](https://help.github.com/articles/fork-a-repo) this repository to your personal or institutional GitHub account (depending on the CLA you are working under). Be cautious of which branches you work from though (you'll want to base your work off the default branch). See [Fork a repo](https://help.github.com/articles/fork-a-repo) for detailed instructions.
1. [Fork](https://help.github.com/articles/fork-a-repo) this repository to your personal or institutional GitHub account (depending on the CLA you are working under). Be cautious of which branches you work from though (you'll want to base your work off master, or for Drupal modules use the most recent version branch). See [Fork a repo](https://help.github.com/articles/fork-a-repo) for detailed instructions.
2. Commit any changes to your fork.
3. Send a [pull request](https://help.github.com/articles/creating-a-pull-request) using the [pull request template](https://github.com/Islandora/documentation/blob/main/.github/PULL_REQUEST_TEMPLATE.md) to the Islandora GitHub repository that you forked in step 1. If your pull request is related to an existing issue -- for instance, because you reported a [bug/issue](https://github.com/Islandora/documentation/issues) earlier -- prefix the title of your pull request with the corresponding issue number (e.g. `issue-123: ...`). Please also include a reference to the issue in the description of the pull. This can be done by using '#' plus the issue number like so '#123', also try to pick an appropriate name for the branch in which you're issuing the pull request from.
3. Send a [pull request](https://help.github.com/articles/creating-a-pull-request) using the [pull request template](https://github.com/Islandora/documentation/blob/master/.github/PULL_REQUEST_TEMPLATE.md) to the Islandora GitHub repository that you forked in step 1. If your pull request is related to an existing issue -- for instance, because you reported a [bug/issue](https://github.com/Islandora/documentation/issues) earlier -- prefix the title of your pull request with the corresponding issue number (e.g. `issue-123: ...`). Please also include a reference to the issue in the description of the pull. This can be done by using '#' plus the issue number like so '#123', also try to pick an appropriate name for the branch in which you're issuing the pull request from.
You may want to read [Syncing a fork](https://help.github.com/articles/syncing-a-fork) for instructions on how to keep your fork up to date with the latest changes of the upstream (official) repository.

10
modules/islandora_iiif/README.md

@ -1,4 +1,4 @@
# Islandora IIIF
# Islandora IIIF
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.2-8892BF.svg?style=flat-square)](https://php.net/)
[![Contribution Guidelines](http://img.shields.io/badge/CONTRIBUTING-Guidelines-blue.svg)](./CONTRIBUTING.md)
@ -11,7 +11,7 @@ Provides IIIF manifests using views.
## Requirements
- `islandora` and `islandora_core_feature`
- A IIIF image server (such as Cantaloupe)
- A IIIF image server (such as Cantaloupe)
## Installation
@ -32,12 +32,6 @@ You can set the following configuration at `admin/config/islandora/iiif`:
- IIIF Image server location
- The URL to your IIIF image server (without trailing slash).
### Views Style Plugin
This module implements a Views Style plugin. It provides the following settings:
1. Tile Source: A field that was added to the views list of fields with the image to be served. This should be a File or Image type field on a Media.
2. Structured Text field: This lets you specify a file field where OCR text with positional data, e.g., hOCR can be found.
## Documentation
Official documentation is available on the [Islandora 8 documentation site](https://islandora.github.io/documentation/).

26
modules/islandora_iiif/config/schema/islandora_iiif.schema.yml

@ -5,29 +5,3 @@ islandora_iiif.settings:
iiif_server:
type: string
label: 'IIIF Server Url'
use_relative_paths:
type: boolean
label: 'Use relative paths in manifest.'
show_title:
type: string
label: 'Show title in view'
views.style.iiif_manifest:
type: views_style
mapping:
iiif_tile_field:
type: sequence
label: "Tile source field(s)"
sequence:
type: string
iiif_ocr_file_field:
type: sequence
label: "Structured OCR data file field"
sequence:
type: string
structured_text_term_uri:
type: string
label: "Structured text term"
search_endpoint:
type: string
label: "Search endpoint path"

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save