Skip to content
Snippets Groups Projects
Commit 6ab83825 authored by Chris Shantz's avatar Chris Shantz
Browse files

Merge branch '1.0.x' into prod/1.0.x

parents 9e9d5302 ff98d411
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ dependencies:
config:
- field.field.node.uw_ct_profile.field_uw_autoplay
- field.field.node.uw_ct_profile.field_uw_banner
- field.field.node.uw_ct_profile.field_uw_blank_summary
- field.field.node.uw_ct_profile.field_uw_ct_profile_affiliation
- field.field.node.uw_ct_profile.field_uw_ct_profile_contact
- field.field.node.uw_ct_profile.field_uw_ct_profile_image
......@@ -50,7 +51,7 @@ third_party_settings:
label: 'Meta tag information for social media sharing/search/etc.'
region: content
parent_name: ''
weight: 21
weight: 22
format_type: details
format_settings:
classes: ''
......@@ -126,6 +127,22 @@ third_party_settings:
open: true
description: ''
required_fields: true
group_summary:
children:
- field_uw_profile_summary
- field_uw_blank_summary
label: Summary
region: content
parent_name: ''
weight: 14
format_type: details
format_settings:
classes: ''
show_empty_fields: false
id: ''
open: true
description: ''
required_fields: true
id: node.uw_ct_profile.default
targetEntityType: node
bundle: uw_ct_profile
......@@ -156,9 +173,16 @@ content:
form_display_mode: default
default_paragraph_type: _none
third_party_settings: { }
field_uw_blank_summary:
type: boolean_checkbox
weight: 16
region: content
settings:
display_label: true
third_party_settings: { }
field_uw_ct_profile_affiliation:
type: string_textfield
weight: 15
weight: 16
region: content
settings:
size: 60
......@@ -183,7 +207,7 @@ content:
third_party_settings: { }
field_uw_ct_profile_info_link:
type: link_default
weight: 17
weight: 18
region: content
settings:
placeholder_url: ''
......@@ -191,7 +215,7 @@ content:
third_party_settings: { }
field_uw_ct_profile_link_contact:
type: link_default
weight: 19
weight: 20
region: content
settings:
placeholder_url: ''
......@@ -202,7 +226,7 @@ content:
maxlength_js_label: 'Content limited to @limit characters, remaining: <strong>@remaining</strong>'
field_uw_ct_profile_link_persona:
type: link_default
weight: 18
weight: 19
region: content
settings:
placeholder_url: ''
......@@ -218,7 +242,7 @@ content:
third_party_settings: { }
field_uw_ct_profile_title:
type: string_textfield
weight: 16
weight: 17
region: content
settings:
size: 60
......@@ -226,7 +250,7 @@ content:
third_party_settings: { }
field_uw_ct_profile_type:
type: autocomplete_deluxe
weight: 20
weight: 21
region: content
settings:
match_operator: CONTAINS
......@@ -283,7 +307,7 @@ content:
third_party_settings: { }
field_uw_profile_summary:
type: text_textarea
weight: 14
weight: 15
region: content
settings:
rows: 5
......@@ -350,18 +374,18 @@ content:
third_party_settings: { }
publish_on:
type: datetime_timestamp_no_default
weight: 27
weight: 28
region: content
settings: { }
third_party_settings: { }
publish_state:
type: scheduler_moderation
weight: 25
weight: 26
region: content
settings: { }
third_party_settings: { }
scheduler_settings:
weight: 23
weight: 24
region: content
settings: { }
third_party_settings: { }
......@@ -407,18 +431,18 @@ content:
third_party_settings: { }
unpublish_on:
type: datetime_timestamp_no_default
weight: 26
weight: 27
region: content
settings: { }
third_party_settings: { }
unpublish_state:
type: scheduler_moderation
weight: 24
weight: 25
region: content
settings: { }
third_party_settings: { }
url_redirects:
weight: 22
weight: 23
region: content
settings: { }
third_party_settings: { }
......
......@@ -4,6 +4,7 @@ dependencies:
config:
- field.field.node.uw_ct_profile.field_uw_autoplay
- field.field.node.uw_ct_profile.field_uw_banner
- field.field.node.uw_ct_profile.field_uw_blank_summary
- field.field.node.uw_ct_profile.field_uw_ct_profile_affiliation
- field.field.node.uw_ct_profile.field_uw_ct_profile_contact
- field.field.node.uw_ct_profile.field_uw_ct_profile_image
......@@ -90,6 +91,16 @@ content:
third_party_settings: { }
weight: 115
region: first
field_uw_blank_summary:
type: boolean
label: above
settings:
format: default
format_custom_false: ''
format_custom_true: ''
third_party_settings: { }
weight: 122
region: first
field_uw_ct_profile_affiliation:
type: string
label: above
......
......@@ -5,6 +5,7 @@ dependencies:
- core.entity_view_mode.node.teaser
- field.field.node.uw_ct_profile.field_uw_autoplay
- field.field.node.uw_ct_profile.field_uw_banner
- field.field.node.uw_ct_profile.field_uw_blank_summary
- field.field.node.uw_ct_profile.field_uw_ct_profile_affiliation
- field.field.node.uw_ct_profile.field_uw_ct_profile_contact
- field.field.node.uw_ct_profile.field_uw_ct_profile_image
......@@ -37,6 +38,7 @@ hidden:
content_moderation_control: true
field_uw_autoplay: true
field_uw_banner: true
field_uw_blank_summary: true
field_uw_ct_profile_affiliation: true
field_uw_ct_profile_contact: true
field_uw_ct_profile_image: true
......
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_uw_blank_summary
- node.type.uw_ct_profile
id: node.uw_ct_profile.field_uw_blank_summary
field_name: field_uw_blank_summary
entity_type: node
bundle: uw_ct_profile
label: 'Intentionally leave summary blank'
description: 'When selected, the summary field will not be used. This may cause usability issues; use only when necessary.'
required: false
translatable: true
default_value:
-
value: 0
default_value_callback: ''
settings:
on_label: 'On'
off_label: 'Off'
field_type: boolean
......@@ -15,7 +15,7 @@ field_name: field_uw_ct_profile_image
entity_type: node
bundle: uw_ct_profile
label: 'Listing page image'
description: 'Leaving image empty will sync image from linked Contact. This happens only on create (not update).'
description: '<p>If there is no image set when the profile is first set to synchronize with a contact, this will be set to that contact’s listing page image, and these images will be kept in sync. The image will also be kept in sync if you use the same media item as that contact. If you set a listing page image to a different image, the listing page image will not be synchronized. You can remove the listing page image from a synchronized profile by removing the image after the synchronized profile has been saved once.</p>'
required: false
translatable: false
default_value: { }
......
......@@ -17,7 +17,7 @@ entity_type: node
bundle: uw_ct_profile
label: Summary
description: ''
required: true
required: false
translatable: false
default_value: { }
default_value_callback: ''
......
This diff is collapsed.
......@@ -2,7 +2,7 @@ name: 'UW Profile'
description: 'Provides Profile content type and related configuration.'
type: module
package: WCMS
core_version_requirement: '^8.9 || ^9'
core_version_requirement: ^9 || ^10
dependencies:
- 'allowed_formats:allowed_formats'
- 'autocomplete_deluxe:autocomplete_deluxe'
......
......@@ -31,7 +31,10 @@ function uw_ct_profile_update_8101(&$sandbox) {
];
// Get all the nids for profiles.
$nids = \Drupal::entityQuery('node')->condition('type', 'uw_ct_profile')->execute();
$nids = \Drupal::entityQuery('node')
->condition('type', 'uw_ct_profile')
->accessCheck(FALSE)
->execute();
// Load all the contact nodes.
$nodes = Node::loadMultiple($nids);
......
......@@ -29,6 +29,28 @@ function uw_ct_profile_form_node_uw_ct_profile_form_alter(&$form, FormStateInter
}
// Modify help text of Link to contact field.
$form['field_uw_ct_profile_link_contact']['widget'][0]['uri']['#description'] = t('Start typing the title of a piece of content to select it. You can also enter an internal path such as <em>/blog</em>.');
// If there is a contact sync, check for form things.
if ($contact_node = $form['field_uw_ct_profile_contact']['widget'][0]['target_id']['#default_value']) {
// Get the entity, which is the node.
$entity = $form_state->getFormObject()->getEntity();
// Perform a check to see if the listing page images are the same
// in the contact and the profile and if so place a message in the
// help text for the profile listing page image.
if ($profile_listing_image = $entity->field_uw_ct_profile_image->getValue()) {
if ($profile_mid = $profile_listing_image[0]['target_id']) {
if ($contact_listing_image = $contact_node->field_uw_contact_listing_image->getValue()) {
if ($contact_mid = $contact_listing_image[0]['target_id']) {
if ($contact_mid == $profile_mid) {
$form['field_uw_ct_profile_image']['widget']['#description'] = $form['field_uw_ct_profile_image']['widget']['#description'] . '<strong/> Unless changed, this image is currently synchronized with the contact.</strong>';
}
}
}
}
}
}
}
/**
......@@ -58,6 +80,9 @@ function _uw_ct_profile_node_form_callback(array &$form, FormStateInterface $for
}
}
// Update the help text for the listing image.
$form['field_uw_ct_profile_image']['widget']['#description'] = $form['field_uw_ct_profile_image']['widget']['#description'] . '<strong/> Unless changed, this image is currently synchronized with the contact.</strong>';
return $form;
}
......@@ -86,12 +111,15 @@ function uw_ct_profile_entity_presave(EntityInterface $entity) {
if ($entity->bundle() === 'uw_ct_profile' &&
$entity->isNew() &&
$entity->field_uw_ct_profile_contact->entity &&
!$entity->field_uw_ct_profile_image->value
$entity->get('field_uw_ct_profile_image')->isEmpty()
) {
// Get contact entity from Link with contact field.
$contact = $entity->field_uw_ct_profile_contact->entity;
// If contact has attached image.
if ($image = $contact->field_uw_ct_contact_image->entity) {
if ($image = $contact->field_uw_contact_listing_image->entity) {
// Update image field of profile with values from contact.
$entity->field_uw_ct_profile_image->target_id = $image->id();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment