diff --git a/.env b/.env index b54fb6d29..cea757d20 100644 --- a/.env +++ b/.env @@ -73,7 +73,7 @@ REPOSITORY=ghcr.io/jhu-sheridan-libraries/idc-isle-dc TAG=upstream-20200824-f8d1e8e-26-g09f74e4 # Docker image and tag for snapshot image -SNAPSHOT_TAG=upstream-20201007-739693ae-251-g0145185.1618855066 +SNAPSHOT_TAG=upstream-20201007-739693ae-243-gffc0114.1619039064 # IdP, SP entity URIs and base URLs SP_BASEURL=https://islandora-idc.traefik.me diff --git a/codebase/composer.json b/codebase/composer.json index 87876b179..24285b175 100644 --- a/codebase/composer.json +++ b/codebase/composer.json @@ -80,6 +80,7 @@ "drupal/role_hierarchy": "^2.2", "drupal/search_api_solr": "^4.1", "drupal/simplesamlphp_auth": "^3.2", + "drupal/title_length": "^1.1", "drupal/transliterate_filenames": "^1.3", "drupal/workbench": "^1.3", "drupal/workbench_access": "^1.0@beta", @@ -89,8 +90,8 @@ "jhu-idc/idc-ui-theme": "dev-develop", "jhu-idc/idc_ui_module": "dev-main", "jhu-idc/islandora_defaults": "dev-8.x-1.x", - "jhu_idc/idc_migration": "^1.0", "jhu-idc/migrate_file": "^1.1", + "jhu_idc/idc_migration": "^1.0", "vlucas/phpdotenv": "^4.0", "webflo/drupal-finder": "^1.0.0", "zaporylie/composer-drupal-optimizations": "^1.0" @@ -163,6 +164,10 @@ "patches": { "simplesamlphp/simplesamlphp": { "SimpleSAMLphp config": "patches/simplesaml_config.patch" + }, + "drupal/title_length": { + "Node title length 1: Apply user config override": "patches/node_title_length_fix-hook-install.patch", + "Node title length 2: Taxonomy name length": "patches/node_title_length_termNameCharLength-3041979-8.patch" } } } diff --git a/codebase/composer.lock b/codebase/composer.lock index 3d75c81d3..d0ebedbb1 100644 --- a/codebase/composer.lock +++ b/codebase/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "50ead380aac04c0153faf55b1c1d46cc", + "content-hash": "e8f6b98d239668593d5e31bed7a1f9f8", "packages": [ { "name": "alchemy/zippy", @@ -5660,6 +5660,62 @@ "source": "https://git.drupalcode.org/project/simplesamlphp_auth" } }, + { + "name": "drupal/title_length", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/title_length.git", + "reference": "8.x-1.1" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/title_length-8.x-1.1.zip", + "reference": "8.x-1.1", + "shasum": "f8a961bcc4cde1bf7c0f57c0a7b6248ea9d92bd4" + }, + "require": { + "drupal/core": "^8 || ^9" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "8.x-1.1", + "datestamp": "1591431505", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + }, + "patches_applied": { + "Node title length 1: Apply user config override": "patches/node_title_length_fix-hook-install.patch", + "Node title length 2: Taxonomy name length": "patches/node_title_length_termNameCharLength-3041979-8.patch" + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "cbccharlie", + "homepage": "https://www.drupal.org/user/616836" + }, + { + "name": "maximpodorov", + "homepage": "https://www.drupal.org/user/515310" + } + ], + "description": "Increases maximum length of node titles.", + "homepage": "https://www.drupal.org/project/title_length", + "keywords": [ + "Drupal" + ], + "support": { + "source": "http://cgit.drupalcode.org/title_length", + "issues": "https://www.drupal.org/project/issues/title_length" + } + }, { "name": "drupal/token", "version": "1.9.0", @@ -7141,12 +7197,12 @@ "source": { "type": "git", "url": "https://github.com/jhu-idc/islandora_defaults.git", - "reference": "ffbbe98f1202ad734ba9b0287221fe722e01c50f" + "reference": "6077efe28faa42b4f2244ad235228dc0f08f63f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jhu-idc/islandora_defaults/zipball/ffbbe98f1202ad734ba9b0287221fe722e01c50f", - "reference": "ffbbe98f1202ad734ba9b0287221fe722e01c50f", + "url": "https://api.github.com/repos/jhu-idc/islandora_defaults/zipball/6077efe28faa42b4f2244ad235228dc0f08f63f1", + "reference": "6077efe28faa42b4f2244ad235228dc0f08f63f1", "shasum": "" }, "require": { @@ -7172,7 +7228,7 @@ "issues": "https://github.com/jhu-idc/islandora_defaults/issues", "source": "https://github.com/jhu-idc/islandora_defaults/tree/8.x-1.x" }, - "time": "2021-04-06T18:04:35+00:00" + "time": "2021-04-20T20:36:15+00:00" }, { "name": "jhu-idc/migrate_file", diff --git a/codebase/config/sync/core.entity_view_display.node.islandora_object.default.yml b/codebase/config/sync/core.entity_view_display.node.islandora_object.default.yml index 861e30006..69cb189c1 100644 --- a/codebase/config/sync/core.entity_view_display.node.islandora_object.default.yml +++ b/codebase/config/sync/core.entity_view_display.node.islandora_object.default.yml @@ -200,7 +200,7 @@ content: settings: date_separator: dash date_order: big_endian - month_format: mmm + month_format: mm day_format: dd third_party_settings: { } type: edtf_default diff --git a/codebase/config/sync/core.extension.yml b/codebase/config/sync/core.extension.yml index 7e96b9628..9d09f2e78 100644 --- a/codebase/config/sync/core.extension.yml +++ b/codebase/config/sync/core.extension.yml @@ -116,6 +116,7 @@ module: system: 0 taxonomy: 0 text: 0 + title_length: 0 token: 0 toolbar: 0 tour: 0 diff --git a/codebase/config/sync/field.field.taxonomy_term.genre.field_authority_link.yml b/codebase/config/sync/field.field.taxonomy_term.genre.field_authority_link.yml index ed7ba73e1..a0cf6e90c 100644 --- a/codebase/config/sync/field.field.taxonomy_term.genre.field_authority_link.yml +++ b/codebase/config/sync/field.field.taxonomy_term.genre.field_authority_link.yml @@ -7,6 +7,11 @@ dependencies: - taxonomy.vocabulary.genre module: - controlled_access_terms + - epp +third_party_settings: + epp: + value: '' + on_update: 1 _core: default_config_hash: TD_N1DFMXQ97lccq2mI7pm3jjKrls24LtDHr4Dgnr3w id: taxonomy_term.genre.field_authority_link @@ -21,9 +26,9 @@ default_value: { } default_value_callback: '' settings: authority_sources: - lgcft: 'Library of Congress Genre/Form Terms' + aat: 'Art & Architecture Thesaurus' fast: 'Faceted Application of Subject Terminology' - other: Other + lgcft: 'Library of Congress Genre/Form Terms' title: 1 link_type: 16 field_type: authority_link diff --git a/codebase/config/sync/migrate_plus.migration.idc_ingest_media_audio.yml b/codebase/config/sync/migrate_plus.migration.idc_ingest_media_audio.yml index 0a9878292..a25e2c536 100644 --- a/codebase/config/sync/migrate_plus.migration.idc_ingest_media_audio.yml +++ b/codebase/config/sync/migrate_plus.migration.idc_ingest_media_audio.yml @@ -18,17 +18,20 @@ source: STATUS: true DISPLAY: true ADMIN: 1 - PUBLIC_FS: "public://" - TMP_FS: "/tmp/" + PUBLIC_FS: 'public://' + TMP_FS: /tmp/ process: _url_filename: - - plugin: callback + - + plugin: callback callable: parse_url source: url - - plugin: extract + - + plugin: extract index: - path - - plugin: callback + - + plugin: callback callable: basename _url_filepath: plugin: concat diff --git a/codebase/config/sync/migrate_plus.migration.idc_ingest_media_document.yml b/codebase/config/sync/migrate_plus.migration.idc_ingest_media_document.yml index 9fd1191bb..282708a7d 100644 --- a/codebase/config/sync/migrate_plus.migration.idc_ingest_media_document.yml +++ b/codebase/config/sync/migrate_plus.migration.idc_ingest_media_document.yml @@ -18,17 +18,20 @@ source: STATUS: true DISPLAY: true ADMIN: 1 - PUBLIC_FS: "public://" - TMP_FS: "/tmp/" + PUBLIC_FS: 'public://' + TMP_FS: /tmp/ process: _url_filename: - - plugin: callback + - + plugin: callback callable: parse_url source: url - - plugin: extract + - + plugin: extract index: - path - - plugin: callback + - + plugin: callback callable: basename _url_filepath: plugin: concat diff --git a/codebase/config/sync/migrate_plus.migration.idc_ingest_media_extracted_text.yml b/codebase/config/sync/migrate_plus.migration.idc_ingest_media_extracted_text.yml index 76bdfe3d6..b7757c547 100644 --- a/codebase/config/sync/migrate_plus.migration.idc_ingest_media_extracted_text.yml +++ b/codebase/config/sync/migrate_plus.migration.idc_ingest_media_extracted_text.yml @@ -18,18 +18,21 @@ source: STATUS: true DISPLAY: true ADMIN: 1 - PUBLIC_FS: "public://" - TMP_FS: "/tmp/" - FORMAT: "basic_html" + PUBLIC_FS: 'public://' + TMP_FS: /tmp/ + FORMAT: basic_html process: _url_filename: - - plugin: callback + - + plugin: callback callable: parse_url source: url - - plugin: extract + - + plugin: extract index: - path - - plugin: callback + - + plugin: callback callable: basename _url_filepath: plugin: concat diff --git a/codebase/config/sync/migrate_plus.migration.idc_ingest_media_file.yml b/codebase/config/sync/migrate_plus.migration.idc_ingest_media_file.yml index febf50403..7d6337dfd 100644 --- a/codebase/config/sync/migrate_plus.migration.idc_ingest_media_file.yml +++ b/codebase/config/sync/migrate_plus.migration.idc_ingest_media_file.yml @@ -18,17 +18,20 @@ source: STATUS: true DISPLAY: true ADMIN: 1 - PUBLIC_FS: "public://" - TMP_FS: "/tmp/" + PUBLIC_FS: 'public://' + TMP_FS: /tmp/ process: _url_filename: - - plugin: callback + - + plugin: callback callable: parse_url source: url - - plugin: extract + - + plugin: extract index: - path - - plugin: callback + - + plugin: callback callable: basename _url_filepath: plugin: concat diff --git a/codebase/config/sync/migrate_plus.migration.idc_ingest_media_image.yml b/codebase/config/sync/migrate_plus.migration.idc_ingest_media_image.yml index 6b2af9afd..b7739a4e2 100644 --- a/codebase/config/sync/migrate_plus.migration.idc_ingest_media_image.yml +++ b/codebase/config/sync/migrate_plus.migration.idc_ingest_media_image.yml @@ -18,17 +18,20 @@ source: STATUS: true DISPLAY: true ADMIN: 1 - PUBLIC_FS: "public://" - TMP_FS: "/tmp/" + PUBLIC_FS: 'public://' + TMP_FS: /tmp/ process: _url_filename: - - plugin: callback + - + plugin: callback callable: parse_url source: url - - plugin: extract + - + plugin: extract index: - path - - plugin: callback + - + plugin: callback callable: basename _url_filepath: plugin: concat diff --git a/codebase/config/sync/migrate_plus.migration.idc_ingest_media_remote_video.yml b/codebase/config/sync/migrate_plus.migration.idc_ingest_media_remote_video.yml index 3f924c9d2..64b00add1 100644 --- a/codebase/config/sync/migrate_plus.migration.idc_ingest_media_remote_video.yml +++ b/codebase/config/sync/migrate_plus.migration.idc_ingest_media_remote_video.yml @@ -18,8 +18,8 @@ source: STATUS: true DISPLAY: true ADMIN: 1 - PUBLIC_FS: "public://" - TMP_FS: "/tmp/" + PUBLIC_FS: 'public://' + TMP_FS: /tmp/ process: name: name field_media_oembed_video: url diff --git a/codebase/config/sync/migrate_plus.migration.idc_ingest_media_video.yml b/codebase/config/sync/migrate_plus.migration.idc_ingest_media_video.yml index 499b60e53..6ed304f2a 100644 --- a/codebase/config/sync/migrate_plus.migration.idc_ingest_media_video.yml +++ b/codebase/config/sync/migrate_plus.migration.idc_ingest_media_video.yml @@ -18,17 +18,20 @@ source: STATUS: true DISPLAY: true ADMIN: 1 - PUBLIC_FS: "public://" - TMP_FS: "/tmp/" + PUBLIC_FS: 'public://' + TMP_FS: /tmp/ process: _url_filename: - - plugin: callback + - + plugin: callback callable: parse_url source: url - - plugin: extract + - + plugin: extract index: - path - - plugin: callback + - + plugin: callback callable: basename _url_filepath: plugin: concat diff --git a/codebase/patches/node_title_length_fix-hook-install.patch b/codebase/patches/node_title_length_fix-hook-install.patch new file mode 100644 index 000000000..bb3d8cf50 --- /dev/null +++ b/codebase/patches/node_title_length_fix-hook-install.patch @@ -0,0 +1,13 @@ +diff --git a/title_length.install b/title_length.install +index 16e673ecd..83592c491 100644 +--- a/title_length.install ++++ b/title_length.install +@@ -32,7 +32,7 @@ function title_length_install() { + // Update storage definition. + $node_type = Drupal::service('entity_type.manager')->getDefinition('node'); + $fields = Node::baseFieldDefinitions($node_type); +- $fields['title']->setSetting('max_length', 500); ++ $fields['title']->setSetting('max_length', $length); + Drupal::entityDefinitionUpdateManager() + ->installFieldStorageDefinition('title', 'node', 'node', $fields['title']); + } diff --git a/codebase/patches/node_title_length_termNameCharLength-3041979-8.patch b/codebase/patches/node_title_length_termNameCharLength-3041979-8.patch new file mode 100644 index 000000000..884ee8b3e --- /dev/null +++ b/codebase/patches/node_title_length_termNameCharLength-3041979-8.patch @@ -0,0 +1,168 @@ +diff --git a/README.txt b/README.txt +index 6817159..d283fdc 100644 +--- a/README.txt ++++ b/README.txt +@@ -11,3 +11,5 @@ If you want another size, you can change this value + before installing the module. To do this, you need + to create the following variable in the settings.php file. + $settings['node_title_length_chars'] = WANTED_SIZE; ++Also, there is a possibility to set length for taxonomy term name field. ++$settings['taxonomy_term_title_length_chars'] = WANTED_SIZE; +diff --git a/title_length.info.yml b/title_length.info.yml +index 6a8905f..3e07785 100644 +--- a/title_length.info.yml ++++ b/title_length.info.yml +@@ -1,8 +1,9 @@ + name: Title length + type: module +-description: Increases maximum length of node titles. ++description: Increases maximum length of node and taxonomy term titles. + core: 8.x + core_version_requirement: ^8 || ^9 + package: Other + dependencies: + - drupal:node ++ - drupal:taxonomy +diff --git a/title_length.install b/title_length.install +index 16e673e..036b581 100644 +--- a/title_length.install ++++ b/title_length.install +@@ -9,6 +9,7 @@ use Drupal\Core\Database\Database; + use Drupal\Core\Extension\ModuleUninstallValidatorException; + use Drupal\Core\Site\Settings; + use Drupal\node\Entity\Node; ++use Drupal\taxonomy\Entity\Term; + + /** + * Implements hook_install(). +@@ -16,9 +17,13 @@ use Drupal\node\Entity\Node; + function title_length_install() { + // Get length of settings. + $length = Settings::get('node_title_length_chars') ?: TITLE_LENGTH_CHARS; ++ $term_length = Settings::get('taxonomy_term_title_length_chars') ?: TITLE_LENGTH_CHARS; + + // Change node title length. + if ($schema = Database::getConnection()->schema()) { ++ $entity_type_manger = Drupal::service('entity_type.manager'); ++ $update_manager = Drupal::entityDefinitionUpdateManager(); ++ + $schema->changeField('node_field_data', 'title', 'title', [ + 'length' => $length, + 'not null' => TRUE, +@@ -30,11 +35,30 @@ function title_length_install() { + 'type' => 'varchar', + ]); + // Update storage definition. +- $node_type = Drupal::service('entity_type.manager')->getDefinition('node'); ++ $node_type = $entity_type_manger->getDefinition('node'); + $fields = Node::baseFieldDefinitions($node_type); + $fields['title']->setSetting('max_length', $length); +- Drupal::entityDefinitionUpdateManager() +- ->installFieldStorageDefinition('title', 'node', 'node', $fields['title']); ++ $update_manager->installFieldStorageDefinition('title', 'node', 'node', $fields['title']); ++ ++ // Change taxonomy term name length. ++ $schema->changeField('taxonomy_term_field_data', 'name', 'name', [ ++ 'length' => $term_length, ++ 'not null' => TRUE, ++ 'type' => 'varchar', ++ ]); ++ ++ // Change taxonomy term name length (revisions table). ++ $schema->changeField('taxonomy_term_field_revision', 'name', 'name', [ ++ 'length' => $term_length, ++ 'not null' => TRUE, ++ 'type' => 'varchar', ++ ]); ++ ++ // Update storage definition. ++ $term_type = $entity_type_manger->getDefinition('taxonomy_term'); ++ $fields = Term::baseFieldDefinitions($term_type); ++ $fields['name']->setSetting('max_length', $term_length); ++ $update_manager->installFieldStorageDefinition('name', 'taxonomy_term', 'taxonomy_term', $fields['name']); + } + } + +@@ -72,12 +96,31 @@ function title_length_uninstall() { + ->execute() + ->fetchField(); + +- if ($long_title_count + $long_revision_title_count > 0) { ++ /** @var \Drupal\Core\Database\Query\Select $query */ ++ $query = Database::getConnection()->select('taxonomy_term_field_data', 'n'); ++ $query->addField('n', 'name'); ++ $query->where("$length_function(name) > 255"); ++ $long_term_title_count = $query->countQuery() ++ ->execute() ++ ->fetchField(); ++ ++ /** @var \Drupal\Core\Database\Query\Select $query */ ++ $query = Database::getConnection()->select('taxonomy_term_field_revision', 'n'); ++ $query->addField('n', 'name'); ++ $query->where("$length_function(name) > 255"); ++ $long_term_revision_title_count = $query->countQuery() ++ ->execute() ++ ->fetchField(); ++ ++ if ($long_title_count + $long_revision_title_count + $long_term_title_count + $long_term_revision_title_count > 0) { + throw new ModuleUninstallValidatorException('Nodes or node revisions exist with long titles. Module cannot be uninstalled.'); + } + + // Change node title length. + if ($schema = $connection->schema()) { ++ $entity_type_manger = Drupal::service('entity_type.manager'); ++ $update_manager = Drupal::entityDefinitionUpdateManager(); ++ + $schema->changeField('node_field_data', 'title', 'title', [ + 'length' => 255, + 'not null' => TRUE, +@@ -89,10 +132,28 @@ function title_length_uninstall() { + 'type' => 'varchar', + ]); + // Update storage definition. +- $node_type = Drupal::service('entity_type.manager')->getDefinition('node'); ++ $node_type = $entity_type_manger->getDefinition('node'); + $fields = Node::baseFieldDefinitions($node_type); +- Drupal::entityDefinitionUpdateManager() +- ->installFieldStorageDefinition('title', 'node', 'node', $fields['title']); ++ $update_manager->installFieldStorageDefinition('title', 'node', 'node', $fields['title']); ++ ++ // Change taxonomy term name length. ++ $schema->changeField('taxonomy_term_field_data', 'name', 'name', [ ++ 'length' => 255, ++ 'not null' => TRUE, ++ 'type' => 'varchar', ++ ]); ++ ++ // Change taxonomy term name length (revisions table). ++ $schema->changeField('taxonomy_term_field_revision', 'name', 'name', [ ++ 'length' => 255, ++ 'not null' => TRUE, ++ 'type' => 'varchar', ++ ]); ++ ++ // Update storage definition. ++ $term_type = $entity_type_manger->getDefinition('taxonomy_term'); ++ $fields = Term::baseFieldDefinitions($term_type); ++ $update_manager->installFieldStorageDefinition('name', 'taxonomy_term', 'taxonomy_term', $fields['name']); + } + + } +diff --git a/title_length.module b/title_length.module +index d48ac8e..fe92311 100644 +--- a/title_length.module ++++ b/title_length.module +@@ -20,4 +20,13 @@ function title_length_entity_base_field_info_alter(&$fields, EntityTypeInterface + $length = Settings::get('node_title_length_chars') ?: TITLE_LENGTH_CHARS; + $fields['title']->setSetting('max_length', $length); + } ++ // Alter the title field of a taxonomy term to change length. ++ if ($entity_type->id() == 'taxonomy_term' && !empty($fields['name'])) { ++ // Get length of settings. ++ $length = Settings::get('taxonomy_term_title_length_chars'); ++ if (empty($length)) { ++ $length = TITLE_LENGTH_CHARS; ++ } ++ $fields['name']->setSetting('max_length', $length); ++ } + } diff --git a/codebase/web/sites/default/settings.local.php b/codebase/web/sites/default/settings.local.php index 0f1e579f6..be7f12ea0 100644 --- a/codebase/web/sites/default/settings.local.php +++ b/codebase/web/sites/default/settings.local.php @@ -1,5 +1,10 @@ Drama Description
+genre-01,Drama,https://www.loc.gov/aba/publications/FreeLCGFT/GENRE.pdf;lgcft|http://vocab.getty.edu/aat/300054152;aat,Drama Description
diff --git a/tests/10-migration-backend-tests/testcafe/migrations/persons-01.csv b/tests/10-migration-backend-tests/testcafe/migrations/persons-01.csv index 46d2b115e..0835c5e7e 100644 --- a/tests/10-migration-backend-tests/testcafe/migrations/persons-01.csv +++ b/tests/10-migration-backend-tests/testcafe/migrations/persons-01.csv @@ -3,3 +3,4 @@ person_1,"Adams, Ansel Easton, 1902-1984",1 Alt Name,1 Preferred Name Fuller For person_2,"Weston, Edward, 1886-1958",2 Alt Name,2 Preferred Name Fuller Form,2 Preferred Name Number,Mr,Edward,Weston,2 Preferred Name Suffix,1886-03-24/1958-01-01,,https://www.wikidata.org/wiki/Q346988;other,"Edward Henry Weston (March 24, 1886 – January 1, 1958) was a 20th-century American photographer. He has been called ""one of the most innovative and influential American photographers...""[1] and ""one of the masters of 20th century photography.""[2] Over the course of his 40-year career Weston photographed an increasingly expansive set of subjects, including landscapes, still lives, nudes, portraits, genre scenes and even whimsical parodies. It is said that he developed a ""quintessentially American, and especially Californian, approach to modern photography""[3] because of his focus on the people and places of the American West. In 1937 Weston was the first photographer to receive a Guggenheim Fellowship, and over the next two years he produced nearly 1,400 negatives using his 8 × 10 view camera. Some of his most famous photographs were taken of the trees and rocks at Point Lobos, California, near where he lived for many years.
" person_3,"Rowell, Galen",3 Alt Name,3 Preferred Name Fuller Form,3 Preferred Name Number,Mr,Galen,Rowell,3 Preferred Name Suffix,1940-08-23/2002-08-11,,https://www.wikidata.org/wiki/Special:EntityPage/Q3094569;other,"Galen Avery Rowell (August 23, 1940 – August 11, 2002) was a wilderness photographer, adventure photojournalist and climber.[2] Born in Oakland, California, he became a full-time photographer in 1972." person_4,"Hine, Lewis Wickes, 1874-1940",Lewis Hines|Lewis W. Hine,Lewis Wickes Hine|Lewis Hine,1st|I,Mr|Another Prefix,Lewis Wickes|Lewis W.,Hine,Suffix1|Suffix2,1874/1940|1874|1940,,https://en.wikipedia.org/wiki/Lewis_Hine;other|https://id.loc.gov/authorities/names/n50034947.html;lcnaf,"Lewis Wickes Hine Hine's photographs supported the NCLC's lobbying to end child labor and in 1912 the Children's Bureau was created. The Fair Labor Standards Act of 1938 eventually brought child labour in the US to an end.
After Hine's death, his son Corydon donated his prints and negatives to the Photo League, which was dismantled in 1951. The Museum of Modern Art was offered his pictures and did not accept them, but the George Eastman House did.
In 2006, author Elizabeth Winthrop Alsop's historical fiction middle-grade novel, Counting on Grace was published by Wendy Lamb Books. The latter chapters center on 12-year-old Grace and her life-changing encounter with Hine, during his 1910 visit to a Vermont cotton mill known to have many child laborers. On the cover is the iconic photo of Grace's real-life counterpart, Addie Card(1897–1993), taken during Hine's undercover visit to the Pownal Cotton Mill.
In 2016, Time published colorized versions of several of Hine's photographs of child labor in the US.
" +person_5,"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia. Nam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer ante arcu, accumsan a, consectetuer eget, posuere ut, mauris. Praesent adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy metus. Vestib",Lorem Ipsum|Lorem W. Ipsum,Lorem Ipsum,,,Lorem,Ipsum,,,,https://en.wikipedia.org/wiki/Lorem_ipsum;other, diff --git a/tests/10-migration-backend-tests/testcafe/migrations/persons-02.csv b/tests/10-migration-backend-tests/testcafe/migrations/persons-02.csv index c2043b0d1..0fb9875e1 100644 --- a/tests/10-migration-backend-tests/testcafe/migrations/persons-02.csv +++ b/tests/10-migration-backend-tests/testcafe/migrations/persons-02.csv @@ -3,3 +3,4 @@ person_1,"Adams, Ansel Easton, 1902-1984",1 Alt Name,1 Preferred Name Fuller For person_2,"Weston, Edward, 1886-1958",2 Alt Name,2 Preferred Name Fuller Form,2 Preferred Name Number,Mr,Edward,Weston,2 Preferred Name Suffix,1886-03-24/1958-01-01,person_1,https://www.wikidata.org/wiki/Q346988;other,"Edward Henry Weston (March 24, 1886 – January 1, 1958) was a 20th-century American photographer. He has been called ""one of the most innovative and influential American photographers...""[1] and ""one of the masters of 20th century photography.""[2] Over the course of his 40-year career Weston photographed an increasingly expansive set of subjects, including landscapes, still lives, nudes, portraits, genre scenes and even whimsical parodies. It is said that he developed a ""quintessentially American, and especially Californian, approach to modern photography""[3] because of his focus on the people and places of the American West. In 1937 Weston was the first photographer to receive a Guggenheim Fellowship, and over the next two years he produced nearly 1,400 negatives using his 8 × 10 view camera. Some of his most famous photographs were taken of the trees and rocks at Point Lobos, California, near where he lived for many years.
" person_3,"Rowell, Galen",3 Alt Name|Another Alt Name,3 Preferred Name Fuller Form|Short Name,3 Preferred Name Number|Another,Mr|Sir,Galen|Test,Rowell,3 Preferred Name Suffix|3 Another suffix,1940-08-23/2002-08-11|1922,,https://www.wikidata.org/wiki/Special:EntityPage/Q3094569;other,"Galen Avery Rowell (August 23, 1940 – August 11, 2002) was a wilderness photographer, adventure photojournalist and climber.[2] Born in Oakland, California, he became a full-time photographer in 1972." person_4,"Hine, Lewis Wickes, 1874-1940",Lewis Hines|Lewis W. Hine,Lewis Wickes Hine|Lewis Hine,1st|I,Mr|Another Prefix,Lewis Wickes|Lewis W.,Hine,Suffix1|Suffix2,1874/1940|1874|1940,person_2,https://en.wikipedia.org/wiki/Lewis_Hine;other|https://id.loc.gov/authorities/names/n50034947.html;lcnaf,"Lewis Wickes Hine Hine's photographs supported the NCLC's lobbying to end child labor and in 1912 the Children's Bureau was created. The Fair Labor Standards Act of 1938 eventually brought child labour in the US to an end.
After Hine's death, his son Corydon donated his prints and negatives to the Photo League, which was dismantled in 1951. The Museum of Modern Art was offered his pictures and did not accept them, but the George Eastman House did.
In 2006, author Elizabeth Winthrop Alsop's historical fiction middle-grade novel, Counting on Grace was published by Wendy Lamb Books. The latter chapters center on 12-year-old Grace and her life-changing encounter with Hine, during his 1910 visit to a Vermont cotton mill known to have many child laborers. On the cover is the iconic photo of Grace's real-life counterpart, Addie Card(1897–1993), taken during Hine's undercover visit to the Pownal Cotton Mill.
In 2016, Time published colorized versions of several of Hine's photographs of child labor in the US.
" +person_5,"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia. Nam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer ante arcu, accumsan a, consectetuer eget, posuere ut, mauris. Praesent adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy metus. Vestib",Lorem Ipsum|Lorem W. Ipsum,Lorem Ipsum,,,Lorem,Ipsum,,,,https://en.wikipedia.org/wiki/Lorem_ipsum;other, diff --git a/tests/10-migration-backend-tests/verification/expected/collection-01.json b/tests/10-migration-backend-tests/verification/expected/collection-01.json index bad964a32..82fb0cd22 100644 --- a/tests/10-migration-backend-tests/verification/expected/collection-01.json +++ b/tests/10-migration-backend-tests/verification/expected/collection-01.json @@ -36,7 +36,6 @@ ], "finding_aid": { - "uri": "http://wikipedia.org", - "title": "Wikipedia" + "uri": "http://wikipedia.org" } } diff --git a/tests/10-migration-backend-tests/verification/expected/collection-03.json b/tests/10-migration-backend-tests/verification/expected/collection-03.json new file mode 100644 index 000000000..e2a5b69af --- /dev/null +++ b/tests/10-migration-backend-tests/verification/expected/collection-03.json @@ -0,0 +1,38 @@ +{ + "type": "node", + "bundle": "collection_object", + "title": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibu", + "title_language": "eng", + "alternative_title": [ + { + "value": "Titre alternatif pour un très long titre", + "language": "fre" + }, + { + "value": "Alternate Title for A very long title", + "language": "eng" + } + ], + "description": [ + { + "value": "This is a description for a collection with a very long title", + "language": "eng" + }, + { + "value": "Esta es una descripción de la colección de un título muy largo", + "language": "spa" + } + ], + "contact_email": "emetsger@gmail.com", + "contact_name": "Elliot Metsger", + "collection_number": [ + "1", "2" + ], + "member_of": [ + "Parent Collection" + ], + "finding_aid": + { + "uri": "http://wikipedia.org" + } +} diff --git a/tests/10-migration-backend-tests/verification/expected/taxonomy-genre.json b/tests/10-migration-backend-tests/verification/expected/taxonomy-genre.json index 07c261037..632e9ad71 100644 --- a/tests/10-migration-backend-tests/verification/expected/taxonomy-genre.json +++ b/tests/10-migration-backend-tests/verification/expected/taxonomy-genre.json @@ -5,13 +5,11 @@ "authority": [ { "uri": "https://www.loc.gov/aba/publications/FreeLCGFT/GENRE.pdf", - "title": "Action/Adventure", "source": "lgcft" }, { - "uri": "http://www.google.com", - "title": "Google Alt Link", - "source": "other" + "uri": "http://vocab.getty.edu/aat/300054152", + "source": "aat" } ], "description": { diff --git a/tests/10-migration-backend-tests/verification/expected/taxonomy-person-03.json b/tests/10-migration-backend-tests/verification/expected/taxonomy-person-03.json new file mode 100644 index 000000000..aaa3cb25e --- /dev/null +++ b/tests/10-migration-backend-tests/verification/expected/taxonomy-person-03.json @@ -0,0 +1,23 @@ +{ + "type": "taxonomy_term", + "bundle": "person", + "name": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia. Nam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer ante arcu, accumsan a, consectetuer eget, posuere ut, mauris. Praesent adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy metus. Vestib", + "primary_name": "Ipsum", + "rest_of_name": [ + "Lorem" + ], + "fuller_form": [ + "Lorem Ipsum" + ], + "alt_name": [ + "Lorem Ipsum", + "Lorem W. Ipsum" + ], + "authority": [ + { + "uri": "https://en.wikipedia.org/wiki/Lorem_ipsum", + "title": "Wikipedia", + "type": "other" + } + ] + } diff --git a/tests/10-migration-backend-tests/verification/verify_migrations_test.go b/tests/10-migration-backend-tests/verification/verify_migrations_test.go index c89b34cc8..6e8496bae 100644 --- a/tests/10-migration-backend-tests/verification/verify_migrations_test.go +++ b/tests/10-migration-backend-tests/verification/verify_migrations_test.go @@ -131,6 +131,45 @@ func verifyTaxonomyTermPerson(t *testing.T, fileName string, restOfName string) assert.Equal(t, expectedJson.Knows[0], relSchemaKnows.JsonApiAttributes.Name) } +// Taxonomy term name lengths are now configurable in settings.local.php, currently set at 2000 for +// a name field. This test ensures that these long names can be entered via ingest. +func Test_VerifyTaxonomyTermLongNamePerson(t *testing.T) { + + expectedJson := ExpectedPerson{} + unmarshalJson(t, "taxonomy-person-03.json", &expectedJson) + + // sanity check the expected json + assert.Equal(t, "taxonomy_term", expectedJson.Type) + assert.Equal(t, "person", expectedJson.Bundle) + assert.Equal(t, "Lorem", expectedJson.RestOfName[0]) + + u := &JsonApiUrl{ + t: t, + baseUrl: DrupalBaseurl, + drupalEntity: expectedJson.Type, + drupalBundle: expectedJson.Bundle, + filter: "field_preferred_name_fuller_form", + value: expectedJson.FullerForm[0], + } + + // retrieve json of the migrated entity from the jsonapi and unmarshal the single response + personRes := &JsonApiPerson{} + u.getSingle(personRes) + + // If we get this far, it means we found it by it's name, so that's a good start. Now check a few other things + // as a sanity test. This is not a comprehensive test of the taxonomy as we've already checked things + // like full terms in other tests. + actual := personRes.JsonApiData[0] + assert.Equal(t, expectedJson.Name, actual.JsonApiAttributes.Name) + assert.Equal(t, expectedJson.Type, actual.Type.entity()) + assert.Equal(t, expectedJson.Bundle, actual.Type.bundle()) + assert.Equal(t, expectedJson.PrimaryName, actual.JsonApiAttributes.PrimaryPartOfName) + assert.ElementsMatch(t, expectedJson.RestOfName, actual.JsonApiAttributes.PreferredNameRest) + assert.ElementsMatch(t, expectedJson.AltName, actual.JsonApiAttributes.PersonAlternateName) + assert.Equal(t, expectedJson.Authority[0].Uri, actual.JsonApiAttributes.Authority[0].Uri) + assert.Equal(t, expectedJson.Authority[0].Type, actual.JsonApiAttributes.Authority[0].Source) +} + func Test_VerifyTaxonomyTermAccessRights(t *testing.T) { expectedJson := ExpectedAccessRights{} unmarshalJson(t, "taxonomy-accessrights.json", &expectedJson) @@ -693,6 +732,37 @@ func Test_VerifyCollection(t *testing.T) { } } +// Node title lengths are now configurable in settings.local.php, currently set at 500 for a node +// This test ensures that these long node titles can be entered via ingest. +func Test_VerifyLongNodeTitle(t *testing.T) { + expectedJson := ExpectedCollection{} + unmarshalJson(t, "collection-03.json", &expectedJson) + + // sanity check the expected json + assert.Equal(t, "node", expectedJson.Type) + assert.Equal(t, "collection_object", expectedJson.Bundle) + + u := &JsonApiUrl{ + t: t, + baseUrl: DrupalBaseurl, + drupalEntity: expectedJson.Type, + drupalBundle: expectedJson.Bundle, + filter: "title", + value: expectedJson.Title, + } + + // retrieve json of the migrated entity from the jsonapi and unmarshal the single response + res := &JsonApiCollection{} + u.getSingle(res) + sourceId := res.JsonApiData[0].Id + assert.NotEmpty(t, sourceId) + + actual := res.JsonApiData[0] + assert.Equal(t, expectedJson.Type, actual.Type.entity()) + assert.Equal(t, expectedJson.Bundle, actual.Type.bundle()) + assert.Equal(t, expectedJson.Title, actual.JsonApiAttributes.Title) +} + func Test_VerifyRepositoryItem(t *testing.T) { expectedJson := ExpectedRepoObj{} unmarshalJson(t, "item-01.json", &expectedJson)