Browse Source

Add PHP 8.2 <strike>and Drupal 10.2</strike> to testing matrix (#987)

* Add PHP 8.2 and Drupal 10.2 to testing matrix
* Use `name` key when creating test content type.
* Remove `gemini_url` from schema.
* Remove gemini_url from islandora.settings.yml
* Update OcrTextFormatter.php
* Remove Drupal 10.2 from matrix, known fail.
pull/992/head
Rosie Le Faive 1 year ago committed by GitHub
parent
commit
d5556f445d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .github/workflows/build-2.x.yml
  2. 1
      config/install/islandora.settings.yml
  3. 3
      config/schema/islandora.schema.yml
  4. 5
      modules/islandora_text_extraction/src/Plugin/Field/FieldFormatter/OcrTextFormatter.php
  5. 2
      tests/src/Kernel/EventGeneratorTest.php

4
.github/workflows/build-2.x.yml

@ -23,10 +23,10 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
php-versions: ["8.1"] php-versions: ["8.1", "8.2"]
# test-suite functional-javascript will appear to pass but will skip tests; missing chromedriver. # test-suite functional-javascript will appear to pass but will skip tests; missing chromedriver.
test-suite: ["kernel", "functional", "functional-javascript"] test-suite: ["kernel", "functional", "functional-javascript"]
drupal-version: ["9.5.x", "10.0.x", "10.1.x"] drupal-version: ["10.0.x", "10.1.x"] # Fails on 10.2 until https://github.com/Islandora/islandora/issues/989 is resolved.
mysql: ["8.0"] mysql: ["8.0"]
allowed_failure: [false] allowed_failure: [false]

1
config/install/islandora.settings.yml

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

3
config/schema/islandora.schema.yml

@ -26,9 +26,6 @@ islandora.settings:
upload_form_allowed_mimetypes: upload_form_allowed_mimetypes:
type: string type: string
label: 'Upload Form Allowed Extensions' label: 'Upload Form Allowed Extensions'
gemini_url:
type: uri
label: 'Url to Gemini microservice'
gemini_pseudo_bundles: gemini_pseudo_bundles:
type: sequence type: sequence
label: 'List of node, media and taxonomy terms that should include the linked Fedora URI' label: 'List of node, media and taxonomy terms that should include the linked Fedora URI'

5
modules/islandora_text_extraction/src/Plugin/Field/FieldFormatter/OcrTextFormatter.php

@ -132,8 +132,9 @@ class OcrTextFormatter extends FormatterBase implements ContainerFactoryPluginIn
$fileItem = $item->getValue(); $fileItem = $item->getValue();
$file = $this->entityTypeManager->getStorage('file')->load($fileItem['target_id']); $file = $this->entityTypeManager->getStorage('file')->load($fileItem['target_id']);
$contents = file_get_contents($file->getFileUri()); $contents = file_get_contents($file->getFileUri());
if (mb_detect_encoding($contents) != 'UTF-8') { $detected_encoding = mb_detect_encoding($contents);
$contents = utf8_encode($contents); if ($detected_encoding != 'UTF-8') {
$contents = mb_convert_encoding($contents, 'UTF-8', $detected_encoding);
} }
$contents = nl2br($contents); $contents = nl2br($contents);
return $contents; return $contents;

2
tests/src/Kernel/EventGeneratorTest.php

@ -49,7 +49,7 @@ class EventGeneratorTest extends IslandoraKernelTestBase {
$test_type = NodeType::create([ $test_type = NodeType::create([
'type' => 'test_type', 'type' => 'test_type',
'label' => 'Test Type', 'name' => 'Test Type',
]); ]);
$test_type->save(); $test_type->save();

Loading…
Cancel
Save