Skip to content

Commit

Permalink
Merge pull request #805 from yalesites-org/hotfix/ys-localist-parser
Browse files Browse the repository at this point in the history
Hotfix: Update LocalistJson function signature
  • Loading branch information
dblanken-yale authored Nov 26, 2024
2 parents 345a7bd + 19ba219 commit 9bdd9cb
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 6 deletions.
4 changes: 2 additions & 2 deletions web/profiles/custom/yalesites_profile/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@
"jjj/chosen": "2.2.1",
"laminas/laminas-escaper": "2.13.0",
"northernco/ckeditor5-anchor-drupal": "0.4.0",
"yalesites-org/ai_engine": "1.2.6",
"yalesites-org/atomic": "1.39.1",
"yalesites-org/ai_engine": "1.2.7",
"yalesites-org/atomic": "1.39.2",
"yalesites-org/yale_cas": "v1.0.5"
},
"minimum-stability": "dev",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ status: true
dependencies:
config:
- field.field.media.document.field_media_file
- field.field.media.document.field_metatags
- field.field.media.document.field_tags
- media.type.document
module:
- chosen_field
- file
- metatag
id: media.document.default
targetEntityType: media
bundle: document
Expand All @@ -21,6 +23,14 @@ content:
settings:
progress_indicator: throbber
third_party_settings: { }
field_metatags:
type: metatag_firehose
weight: 3
region: content
settings:
sidebar: true
use_details: true
third_party_settings: { }
field_tags:
type: chosen_select
weight: 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dependencies:
config:
- core.entity_form_mode.media.media_library
- field.field.media.document.field_media_file
- field.field.media.document.field_metatags
- field.field.media.document.field_tags
- media.type.document
module:
Expand Down Expand Up @@ -38,6 +39,7 @@ content:
third_party_settings: { }
hidden:
created: true
field_metatags: true
path: true
revision_log_message: true
status: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ status: true
dependencies:
config:
- field.field.media.document.field_media_file
- field.field.media.document.field_metatags
- field.field.media.document.field_tags
- media.type.document
module:
Expand All @@ -22,6 +23,7 @@ content:
region: content
hidden:
created: true
field_metatags: true
field_tags: true
name: true
search_api_excerpt: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dependencies:
config:
- core.entity_view_mode.media.media_library
- field.field.media.document.field_media_file
- field.field.media.document.field_metatags
- field.field.media.document.field_tags
- image.style.media_library
- media.type.document
Expand All @@ -29,6 +30,7 @@ content:
hidden:
created: true
field_media_file: true
field_metatags: true
field_tags: true
name: true
search_api_excerpt: true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
uuid: 3c7d1cca-b0b1-4ee7-886b-ad6fa0400e92
langcode: en
status: true
dependencies:
config:
- field.storage.media.field_metatags
- media.type.document
module:
- metatag
id: media.document.field_metatags
field_name: field_metatags
entity_type: media
bundle: document
label: Metadata
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: metatag
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
uuid: 241ba697-d6b1-4a31-88e4-a696c1aee334
langcode: en
status: true
dependencies:
module:
- media
- metatag
id: media.field_metatags
field_name: field_metatags
entity_type: media
type: metatag
settings: { }
module: metatag
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
entity_type_groups:
media:
document:
ai_engine: ai_engine
node:
event:
basic: basic
Expand All @@ -7,12 +10,14 @@ entity_type_groups:
post:
basic: basic
open_graph: open_graph
separator: ','
tag_trim_method: beforeValue
use_maxlength: true
tag_trim_maxlength:
metatag_maxlength_abstract: null
metatag_maxlength_description: null
metatag_maxlength_title: null
metatag_maxlength_og_description: null
metatag_maxlength_description: null
metatag_maxlength_abstract: null
metatag_maxlength_og_site_name: null
metatag_maxlength_og_title: null
metatag_maxlength_og_description: null
tag_scroll_max_height: ''
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ class LocalistJson extends Json implements ContainerFactoryPluginInterface, Data
*
* @param string $url
* URL of a JSON feed.
* @param string|int $item_selector
* (optional) If the JSON data is nested, this is a selector to the
* specific data. Does nothing here.
*
* @throws \GuzzleHttp\Exception\RequestException
*/
protected function getSourceData(string $url): array {
protected function getSourceData(string $url, string|int $item_selector = ''): array {
$response = $this->getDataFetcherPlugin()->getResponseContent($url);
// Convert objects to associative arrays.
$source_data = json_decode($response, TRUE, 512, JSON_THROW_ON_ERROR);
Expand Down

0 comments on commit 9bdd9cb

Please sign in to comment.