Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

D9 islandora #809

Merged
merged 77 commits into from
Dec 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
c44b957
update messenger for d9
elizoller Nov 18, 2020
8eb7dee
fix dependency injection
elizoller Nov 19, 2020
3b23a86
update info files
elizoller Nov 19, 2020
406a75d
stream_for updates for d9
elizoller Nov 19, 2020
2b726b9
remove deprecated entity query
elizoller Nov 23, 2020
56ae235
replace deprecated functions
elizoller Nov 23, 2020
bba922f
use dependency injection for messenger and fix other deprecated funct…
elizoller Nov 23, 2020
96b496a
fix deprecations in tests
elizoller Nov 23, 2020
3bb741f
fix test
elizoller Nov 23, 2020
1e3dbae
phpcs fixes
elizoller Nov 24, 2020
94c1931
fix toUrl method
elizoller Nov 24, 2020
bb09637
properly use StringTranslationTrait
elizoller Nov 24, 2020
1ed788a
phpcs fixes and using dependency injection
elizoller Nov 24, 2020
d4a51be
more deprecations with upgrade_status 3.x version and more phpcs fixes
elizoller Nov 24, 2020
b2e7108
add defaultTheme per https://www.drupal.org/node/3083055
elizoller Nov 25, 2020
0b165a8
replace deprecated context definition method - per https://www.drupal…
elizoller Nov 25, 2020
51158aa
fix context definitions
elizoller Nov 25, 2020
eecbd83
remove more deprecations
elizoller Nov 25, 2020
8ed7611
fix deprecations in tests
elizoller Nov 25, 2020
de4fcbb
codesniffer fixes - dependencies must be prefixed with drupal: and mi…
elizoller Nov 25, 2020
ec648e6
replace more url() -> toUrl() and remove unused variables
elizoller Nov 30, 2020
3172f9f
more code sniffer fixes
elizoller Nov 30, 2020
5b08b76
some of these urls are necessary as strings
elizoller Dec 1, 2020
93bcac2
d9 requires update to flysystem module
elizoller Dec 4, 2020
fcf78dc
update migrate_source_csv
elizoller Dec 4, 2020
01fdcfb
temporarily point crayfish-commons to branch with d9 dependencies
elizoller Dec 7, 2020
073ec09
another composer dependency adjustment
elizoller Dec 8, 2020
a4b389b
point composer to d9 branch of jsonld
elizoller Dec 8, 2020
6b409dc
remove hook_post_action for d9
elizoller Dec 8, 2020
251f28c
remove hook_post_action as a dependency - this does break multifile m…
elizoller Dec 8, 2020
02e2cb2
update migration keys -> ids per https://www.drupal.org/node/3060246
elizoller Dec 8, 2020
183b707
fix url method
elizoller Dec 10, 2020
ec4ee15
merge 8.x-1.x
elizoller Dec 10, 2020
2dc07e5
point jsonld back to dev since PR has been merged
elizoller Dec 10, 2020
697efee
wrong branch name
elizoller Dec 10, 2020
6f51488
add update hook for change in migration source
elizoller Dec 10, 2020
5d35dba
update travis.yml for php 7.4
elizoller Dec 11, 2020
a7b26a7
add doc comment
elizoller Dec 11, 2020
36b959a
merge 8.x-1.x
elizoller Dec 11, 2020
d4e2c72
Merge branch 'd9_islandora' of https://github.com/asulibraries/island…
elizoller Dec 11, 2020
3643ae9
build on php7.2, 7.3, 7.4
elizoller Dec 11, 2020
1083d92
use this instead of Drupal::
elizoller Dec 11, 2020
354d590
just php 7.3 and 7.4
elizoller Dec 11, 2020
637ef08
swap back to dev-dev crayfish-commons since PR was merged
elizoller Dec 14, 2020
311196b
perhaps this fixes the config thing
elizoller Dec 15, 2020
5543731
trying to fix config
elizoller Dec 15, 2020
1d19ca0
ugh errant semicolon
elizoller Dec 15, 2020
90b7553
missing variable name
elizoller Dec 15, 2020
4f8fef8
maybe it would help if i named the variables consistently
elizoller Dec 15, 2020
758fc1d
please work...
elizoller Dec 15, 2020
da26e5e
i can't get the dependency injection of config correct
elizoller Dec 15, 2020
b9adac5
sad panda
elizoller Dec 15, 2020
f547b35
thanks @seth-shaw-unlv for this magical fix
elizoller Dec 15, 2020
339391a
fix dependency injection
elizoller Dec 15, 2020
50a64ea
putting the config in the AbstractGenerateDerivativeMediaFile class i…
elizoller Dec 15, 2020
843fda9
already the system.file config
elizoller Dec 15, 2020
b713f4c
update test module info file
elizoller Dec 16, 2020
7a5bcfa
fix implode ordre of parameters
elizoller Dec 16, 2020
a5f9505
remove unused use statement
elizoller Dec 16, 2020
985f778
fix geminiclient tests
elizoller Dec 16, 2020
4a8f23d
phpcs fix
elizoller Dec 16, 2020
3c3262b
check for fedora key in flysystem
elizoller Dec 16, 2020
24ed82c
check for array not being null
elizoller Dec 16, 2020
1ab05e7
more null checks
elizoller Dec 16, 2020
e5c1038
try on the downgrade-symfony branch
elizoller Dec 17, 2020
33764db
set fedora url to null if it isn't in the settings
elizoller Dec 17, 2020
3850750
testing the crayfish-commons version fix
elizoller Dec 17, 2020
8606a96
fixes for new classes in newer version of guzzlehttp but still needin…
elizoller Dec 17, 2020
8dc7210
update phpunit.xml?
elizoller Dec 17, 2020
788b570
transform 1 response from preg_match to a boolean
elizoller Dec 17, 2020
6a311c8
reorder crayfish-commons version fix
elizoller Dec 17, 2020
51cd810
code sniffer fixes
elizoller Dec 17, 2020
0ce9b3e
abstract awaying the shared constructor so that phpcpd is happy about…
elizoller Dec 18, 2020
433d033
attempt to reduce shared code in the FedoraAdapterTest
elizoller Dec 18, 2020
ce14534
remove unused use statement
elizoller Dec 18, 2020
d8e7a2d
code sniffer fixes...not sure how i missed these...
elizoller Dec 18, 2020
f6a6f41
remove reliance on branch of crayfish-commons since PR has been merged
elizoller Dec 18, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
sudo: true
language: php
php:
- 7.2
- 7.3
- 7.4

env:
- TESTSUITE=kernel
Expand All @@ -11,8 +11,6 @@ env:

matrix:
fast_finish: true
allow_failures:
- php: 7.3

services:
- mysql
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
],
"require": {
"drupal/context": "^4.0",
"drupal/context": "^4.0@beta",
"drupal/search_api": "~1.8",
"islandora/jsonld": "dev-8.x-1.x",
"stomp-php/stomp-php": "4.*",
Expand All @@ -25,9 +25,9 @@
"drupal/features" : "^3.7",
"drupal/migrate_plus" : "^5.1",
"drupal/migrate_tools" : "^5.0",
"drupal/migrate_source_csv" : "^2.1",
"drupal/migrate_source_csv" : "^3.4",
"drupal/token" : "^1.3",
"drupal/flysystem" : "^1.0",
"drupal/flysystem" : "^2.0@alpha",
"islandora/crayfish-commons": "dev-dev",
"drupal/file_replace": "^1.1"

Expand Down
1 change: 1 addition & 0 deletions drush.services.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
services:
islandora.commands:
class: \Drupal\islandora\Commands\IslandoraCommands
arguments: ['@entity_type.manager', '@current_user', '@account_switcher']
tags:
- { name: drush.command }
53 changes: 27 additions & 26 deletions islandora.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,31 @@ description: "Islandora Core"
type: module
package: Islandora
core: 8.x
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we need to remove this (per the drupal docs as Islandora relies on functionality introduced in 8.7.x (for example as part of this PR, the deprecation of $context and addition of $context_definitions)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qadan ah i think you're right about context. i don't see anywhere that states that we only support 8.7 and up so before i just want to check with @dannylamb before removing support for that (by removing the core: 8.x part)

core_version_requirement: ^8 || ^9
dependencies:
- block
- node
- path
- text
- options
- link
- jsonld
- search_api
- jwt
- rest
- filehash
- basic_auth
- context_ui
- action
- eva
- taxonomy
- views_ui
- media
- prepopulate
- features_ui
- migrate_tools
- migrate_source_csv
- content_translation
- flysystem
- token
- file_replace
- drupal:block
- drupal:node
- 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:views_ui
- drupal:media
- drupal:prepopulate
- drupal:features_ui
- drupal:migrate_tools
- drupal:migrate_source_csv
- drupal:content_translation
- drupal:flysystem
- drupal:token
- drupal:file_replace
15 changes: 15 additions & 0 deletions islandora.install
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,18 @@ function islandora_update_8003(&$sandbox) {
->schema()
->dropTable('islandora_version_count');
}

/**
* Renames migration source keys -> ids.
*/
function islandora_update_8004() {
$config_factory = \Drupal::configFactory();
$config = $config_factory->getEditable('migrate_plus.migration.islandora__tags');
if ($config) {
if (!$config->get('source.ids')) {
$config->set('source.ids', $config->get('source.keys'));
$config->clear('source.keys');
$config->save(TRUE);
}
}
}
2 changes: 1 addition & 1 deletion islandora.module
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function islandora_file_insert(FileInterface $file) {
*/
function islandora_file_update(FileInterface $file) {
// Exit early if unchanged.
if ($file->filehash['sha1'] == $file->original->filehash['sha1']) {
if ($file->filehash != NULL && $file->original->filehash != NULL && $file->filehash['sha1'] == $file->original->filehash['sha1']) {
return;
}

Expand Down
2 changes: 0 additions & 2 deletions islandora.routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,3 @@ islandora.confirm_delete_media_and_file:
_form: 'Drupal\islandora\Form\ConfirmDeleteMediaAndFile'
requirements:
_permission: 'administer media+delete any media'


4 changes: 2 additions & 2 deletions islandora.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ services:
- { name: 'context_provider' }
islandora.media_source_service:
class: Drupal\islandora\MediaSource\MediaSourceService
arguments: ['@entity_type.manager', '@current_user', '@language_manager', '@entity.query', '@file_system', '@islandora.utils']
arguments: ['@entity_type.manager', '@current_user', '@language_manager', '@file_system', '@islandora.utils']
islandora.utils:
class: Drupal\islandora\IslandoraUtils
arguments: ['@entity_type.manager', '@entity_field.manager', '@entity.query', '@context.manager', '@flysystem_factory', '@language_manager']
arguments: ['@entity_type.manager', '@entity_field.manager', '@context.manager', '@flysystem_factory', '@language_manager']
islandora.gemini.client:
class: Islandora\Crayfish\Commons\Client\GeminiClient
factory: ['Drupal\islandora\GeminiClientFactory', create]
Expand Down
3 changes: 2 additions & 1 deletion modules/islandora_audio/islandora_audio.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ description: 'Islandora audio derivative actions'
type: module
package: Islandora
core: 8.x
core_version_requirement: ^8 || ^9
dependencies:
- islandora
- drupal:islandora
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public function defaultConfiguration() {
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form = parent::buildConfigurationForm($form, $form_state);
$form['mimetype']['#description'] = t('Mimetype to convert to (e.g. audio/mpeg, audio/m4a, etc...)');
$form['args']['#description'] = t('Additional command line parameters for FFMpeg');
$form['mimetype']['#description'] = $this->t('Mimetype to convert to (e.g. audio/mpeg, audio/m4a, etc...)');
$form['args']['#description'] = $this->t('Additional command line parameters for FFMpeg');
return $form;
}

Expand All @@ -48,7 +48,7 @@ public function validateConfigurationForm(array &$form, FormStateInterface $form
if ($exploded_mime[0] != 'audio') {
$form_state->setErrorByName(
'mimetype',
t('Please enter a audio mimetype (e.g. audio/mpeg, audio/m4a, etc...)')
$this->t('Please enter a audio mimetype (e.g. audio/mpeg, audio/m4a, etc...)')
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function testGenerateAudioDerivativeFromScratch() {
// 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(t('Create'));
$this->getSession()->getPage()->pressButton($this->t('Create'));
$this->assertSession()->statusCodeEquals(200);

$this->getSession()->getPage()->fillField('edit-label', "Generate audio test derivative");
Expand All @@ -53,7 +53,7 @@ public function testGenerateAudioDerivativeFromScratch() {
$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(t('Save'));
$this->getSession()->getPage()->pressButton($this->t('Save'));
$this->assertSession()->statusCodeEquals(200);

// Create a context and add the action as a derivative reaction.
Expand All @@ -68,7 +68,7 @@ public function testGenerateAudioDerivativeFromScratch() {
'field_media_of[0][target_id]' => 'Test Node',
'field_tags[0][target_id]' => 'Preservation Master',
];
$this->drupalPostForm('media/add/' . $this->testMediaType->id(), $values, t('Save'));
$this->drupalPostForm('media/add/' . $this->testMediaType->id(), $values, $this->t('Save'));

$expected = [
'source_uri' => 'test_file.txt',
Expand Down
3 changes: 2 additions & 1 deletion modules/islandora_breadcrumbs/islandora_breadcrumbs.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: 'Islandora Breadcrumbs'
type: module
description: 'Builds breadcrumbs based on field_member_of relationships.'
core: 8.x
core_version_requirement: ^8 || ^9
package: Islandora
dependencies:
- islandora
- drupal:islandora
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ source:
plugin: csv
path: modules/contrib/islandora/migrate/tags.csv
header_row_count: 1
keys:
ids:
- external_uri
process:
name: name
Expand Down
45 changes: 23 additions & 22 deletions modules/islandora_core_feature/islandora_core_feature.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,28 @@ name: 'Islandora Core Feature'
description: 'Minimum configuration required for Islandora.'
type: module
core: 8.x
core_version_requirement: ^8 || ^9
dependencies:
- basic_auth
- content_translation
- eva
- features
- field
- file
- filehash
- image
- islandora
- jsonld
- jwt
- language
- link
- media
- migrate_plus
- node
- rest
- serialization
- system
- taxonomy
- user
- views
- drupal:basic_auth
- drupal:content_translation
- drupal:eva
- drupal:features
- drupal:field
- drupal:file
- drupal:filehash
- drupal:image
- drupal:islandora
- drupal:jsonld
- drupal:jwt
- drupal:language
- drupal:link
- drupal:media
- drupal:migrate_plus
- drupal:node
- drupal:rest
- drupal:serialization
- drupal:system
- drupal:taxonomy
- drupal:user
- drupal:views
package: Islandora
3 changes: 2 additions & 1 deletion modules/islandora_iiif/islandora_iiif.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: 'Islandora IIIF'
type: module
description: 'IIIF support for Islandora'
core: 8.x
core_version_requirement: ^8 || ^9
package: Islandora
dependencies:
- islandora
- drupal:islandora
36 changes: 34 additions & 2 deletions modules/islandora_iiif/src/Form/IslandoraIIIFConfigForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,49 @@

namespace Drupal\islandora_iiif\Form;

use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Component\Utility\UrlHelper;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Exception\ClientException;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
* Form to configure IslandoraIIIF.
*/
class IslandoraIIIFConfigForm extends ConfigFormBase {

/**
* The HTTP client to fetch the files with.
*
* @var \GuzzleHttp\ClientInterface
*/
protected $httpClient;

/**
* IslandoraIIIFConfigForm constructor.
*
* @param \GuzzleHttp\ClientInterface $http_client
* A Guzzle client object.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory service.
*/
public function __construct(ClientInterface $http_client, ConfigFactoryInterface $config_factory) {
parent::__construct($config_factory);
$this->httpClient = $http_client;
}

/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('http_client'),
$container->get('config.factory')
);
}

/**
* {@inheritdoc}
*/
Expand Down Expand Up @@ -78,9 +111,8 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
* True if server returns 200 on a HEAD request.
*/
private function validateIiifUrl($server_uri) {
$client = \Drupal::httpClient();
try {
$result = $client->head($server_uri);
$result = $this->httpClient->head($server_uri);
return ($result->getStatusCode() == 200);
}
catch (ClientException $e) {
Expand Down
Loading