Skip to content

Commit

Permalink
merge upstream (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
seth-shaw-unlv authored Nov 10, 2020
1 parent 5bcf474 commit 720e64e
Show file tree
Hide file tree
Showing 32 changed files with 262 additions and 93 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:
branches:
only:
- /^8.x/
- /master/
- /main/

before_install:
- export SCRIPT_DIR=$HOME/islandora/.scripts
Expand All @@ -27,6 +27,7 @@ install:
- $SCRIPT_DIR/travis_setup_drupal.sh
- git -C "$TRAVIS_BUILD_DIR" checkout -b travis-testing
- cd $DRUPAL_DIR;
- chmod -R u+w web/sites/default
- COMPOSER_MEMORY_LIMIT=-1 php -d memory_limit=-1 $COMPOSER_PATH config repositories.local path "$TRAVIS_BUILD_DIR"
- COMPOSER_MEMORY_LIMIT=-1 php -d memory_limit=-1 $COMPOSER_PATH require "islandora/controlled_access_terms:dev-travis-testing as dev-8.x-1.x" --prefer-source --update-with-dependencies
- cd web; drush --uri=127.0.0.1:8282 en -y controlled_access_terms
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ If you are reading this document then you are interested in contributing to Isla

## Workflows

The group meets each Wednesday at 1:00 PM Eastern. Meeting notes and announcements are posted to the [Islandora community list](https://groups.google.com/forum/#!forum/islandora) and the [Islandora developers list](https://groups.google.com/forum/#!forum/islandora-dev). You can view meeting agendas, notes, and call-in information [here](https://github.com/Islandora/documentation/wiki#islandora-8-tech-calls). Anybody is welcome to join the calls, and add items to the agenda.
The Islandora 8 Tech Call meets each Wednesday at 1:00 PM Eastern, and the Islandora 8 User Call meets every second Thursday at 1:00 PM Eastern. Meeting notes and announcements are posted to the [Islandora community list](https://groups.google.com/forum/#!forum/islandora) and the [Islandora developers list](https://groups.google.com/forum/#!forum/islandora-dev). You can view meeting agendas, notes, and call-in information [here](https://github.com/Islandora/documentation/wiki#islandora-8-tech-calls). Anybody is welcome to join the calls, and add items to the agenda.

### Use cases

If you would like to submit a use case to the Islandora 8 project, please submit an issue [here](https://github.com/Islandora/documentation/issues/new) using the [Use Case template](https://github.com/Islandora/documentation/wiki/Use-Case-template), prepending "Use Case:" to the title of the issue.

### 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/master/CONTRIBUTING.md#contribute-code). All documentation resides in [`docs`](https://github.com/Islandora/documentation/tree/master/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/main/CONTRIBUTING.md#contribute-code). All documentation resides in [`docs`](https://github.com/Islandora/documentation/tree/main/docs).

### Request a new feature

Expand Down Expand Up @@ -58,9 +58,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 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.
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 main, 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.
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.

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.

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Integration project](https://github.com/UNLV-Libraries/archivesspace-drupal) and
This module requires the following modules:

- [name](https://www.drupal.org/project/name)
- [auto_entitylabel](https://www.drupal.org/project/auto_entitylabel)
- [geolocation](https://www.drupal.org/project/geolocation)
- [token](https://www.drupal.org/project/token)

Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
}
],
"require": {
"drupal/name": "1.x-dev",
"drupal/geolocation": "^3.0",
"drupal/token": "^1.3"
},
Expand All @@ -24,6 +23,9 @@
"drupal/coder": "*",
"sebastian/phpcpd": "*"
},
"suggest": {
"drupal/name": "Provides western-centric structured names."
},
"license": "GPL-2.0-or-later",
"authors": [
{
Expand Down
1 change: 0 additions & 1 deletion controlled_access_terms.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ core: 8.x
package: 'Controlled Access Terms'

dependencies:
- name
- geolocation
- token
20 changes: 20 additions & 0 deletions controlled_access_terms.module
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,28 @@ function controlled_access_terms_jsonld_alter_normalized_array(EntityInterface $
if (!empty($entity->get($field)->getValue())) {
if ($field_definition->getType() == 'typed_relation') {
foreach ($entity->get($field)->getValue() as $value) {
if (empty($value['target_id'])) {
\Drupal::logger('controlled_access_terms')->warning("Missing target entity for %field in %entity_type/%id (%bundle)",
[
'%field' => $field,
'%entity_type' => $entity->getEntityTypeId(),
'%bundle' => $entity->bundle(),
'%id' => $entity->id(),
]);
continue;
}
$predicate = NormalizerBase::escapePrefix($value['rel_type'], $context['namespaces']);
$referenced_entity = \Drupal::entityTypeManager()->getStorage($field_definition->getSetting('target_type'))->load($value['target_id']);
if (empty($referenced_entity)) {
\Drupal::logger('controlled_access_terms')->warning("Invalid target entity for %field in %entity_type/%id (%bundle)",
[
'%field' => $field,
'%entity_type' => $entity->getEntityTypeId(),
'%bundle' => $entity->bundle(),
'%id' => $entity->id(),
]);
continue;
}
// We are assuming the first graph is the one corresponding
// to the node/taxonomy_term we are modifying.
$normalized['@graph'][0][$predicate][] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ langcode: en
status: true
dependencies:
config:
- field.field.taxonomy_term.person.field_alternate_name
- field.field.taxonomy_term.person.field_authority_link
- field.field.taxonomy_term.person.field_cat_date_begin
- field.field.taxonomy_term.person.field_cat_date_end
- field.field.taxonomy_term.person.field_person_alternate_names
- field.field.taxonomy_term.person.field_person_preferred_name
- field.field.taxonomy_term.person.field_relationships
- taxonomy.vocabulary.person
module:
- controlled_access_terms
- name
- path
- text
id: taxonomy_term.person.default
Expand All @@ -20,14 +18,21 @@ bundle: person
mode: default
content:
description:
type: text_textfield
weight: 10
type: text_textarea
weight: 5
settings:
rows: 9
summary_rows: 3
placeholder: ''
third_party_settings: { }
region: content
field_alternate_name:
weight: 4
settings:
size: 60
placeholder: ''
third_party_settings: { }
type: string_textfield
region: content
field_authority_link:
weight: 1
settings:
Expand All @@ -37,39 +42,30 @@ content:
type: authority_link_default
region: content
field_cat_date_begin:
weight: 26
weight: 7
settings:
strict_dates: false
intervals: false
sets: false
third_party_settings: { }
type: edtf_default
region: content
field_cat_date_end:
weight: 27
weight: 8
settings:
strict_dates: false
intervals: false
sets: false
third_party_settings: { }
type: edtf_default
region: content
field_person_alternate_names:
weight: 3
settings: { }
third_party_settings: { }
type: name_default
region: content
field_person_preferred_name:
weight: 2
settings: { }
third_party_settings: { }
type: name_default
region: content
field_relationships:
weight: 29
weight: 9
settings:
match_operator: CONTAINS
size: '60'
placeholder: ''
match_limit: 10
third_party_settings: { }
type: typed_relation_default
region: content
Expand All @@ -82,15 +78,27 @@ content:
third_party_settings: { }
name:
type: string_textfield
weight: -5
weight: 0
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
path:
type: path
weight: 8
weight: 3
region: content
settings: { }
third_party_settings: { }
status:
type: boolean_checkbox
settings:
display_label: true
weight: 10
region: content
third_party_settings: { }
translation:
weight: 6
region: content
settings: { }
third_party_settings: { }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
langcode: en
status: true
dependencies:
config:
- field.field.taxonomy_term.resource_types.field_authority_link
- taxonomy.vocabulary.resource_types
module:
- controlled_access_terms
- link
- path
- text
id: taxonomy_term.resource_types.default
targetEntityType: taxonomy_term
bundle: resource_types
mode: default
content:
description:
type: text_textarea
weight: 1
region: content
settings:
placeholder: ''
rows: 5
third_party_settings: { }
field_authority_link:
weight: 2
settings:
placeholder_url: ''
placeholder_title: ''
third_party_settings: { }
type: link_default
region: content
langcode:
type: language_select
weight: 3
region: content
settings:
include_locked: true
third_party_settings: { }
name:
type: string_textfield
weight: 0
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
path:
type: path
weight: 5
region: content
settings: { }
third_party_settings: { }
translation:
weight: 4
region: content
settings: { }
third_party_settings: { }
hidden: { }
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ langcode: en
status: true
dependencies:
config:
- field.field.taxonomy_term.person.field_alternate_name
- field.field.taxonomy_term.person.field_authority_link
- field.field.taxonomy_term.person.field_cat_date_begin
- field.field.taxonomy_term.person.field_cat_date_end
- field.field.taxonomy_term.person.field_person_alternate_names
- field.field.taxonomy_term.person.field_person_preferred_name
- field.field.taxonomy_term.person.field_relationships
- taxonomy.vocabulary.person
module:
- controlled_access_terms
- name
- text
id: taxonomy_term.person.default
targetEntityType: taxonomy_term
Expand All @@ -21,12 +19,20 @@ content:
description:
label: hidden
type: text_default
weight: 4
weight: 2
settings: { }
third_party_settings: { }
region: content
field_alternate_name:
weight: 1
label: above
settings:
link_to_entity: false
third_party_settings: { }
type: string
region: content
field_authority_link:
weight: 2
weight: 0
label: above
settings:
trim_length: 80
Expand All @@ -38,7 +44,7 @@ content:
type: authority_formatter_default
region: content
field_cat_date_begin:
weight: 6
weight: 3
label: above
settings:
date_separator: space
Expand All @@ -49,7 +55,7 @@ content:
type: edtf_default
region: content
field_cat_date_end:
weight: 7
weight: 4
label: above
settings:
date_separator: space
Expand All @@ -59,40 +65,8 @@ content:
third_party_settings: { }
type: edtf_default
region: content
field_person_alternate_names:
weight: 3
label: above
settings:
format: default
markup: false
output: default
multiple: default
multiple_delimiter: ', '
multiple_and: text
multiple_delimiter_precedes_last: never
multiple_el_al_min: '3'
multiple_el_al_first: '1'
third_party_settings: { }
type: name_default
region: content
field_person_preferred_name:
weight: 1
label: above
settings:
format: default
markup: false
output: default
multiple: default
multiple_delimiter: ', '
multiple_and: text
multiple_delimiter_precedes_last: never
multiple_el_al_min: '3'
multiple_el_al_first: '1'
third_party_settings: { }
type: name_default
region: content
field_relationships:
weight: 9
weight: 5
label: above
settings:
link: true
Expand All @@ -101,3 +75,4 @@ content:
region: content
hidden:
langcode: true
search_api_excerpt: true
Loading

0 comments on commit 720e64e

Please sign in to comment.