Commit 418be2be authored by Chris Shantz's avatar Chris Shantz
Browse files

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

parents de1b7c39 2a7d1431
...@@ -30,6 +30,8 @@ dependencies: ...@@ -30,6 +30,8 @@ dependencies:
- media_library - media_library
- metatag - metatag
- path - path
- scheduler
- scheduler_content_moderation_integration
- smart_date - smart_date
- term_reference_tree - term_reference_tree
- text - text
...@@ -344,6 +346,23 @@ content: ...@@ -344,6 +346,23 @@ content:
settings: settings:
display_label: true display_label: true
third_party_settings: { } third_party_settings: { }
publish_on:
type: datetime_timestamp_no_default
weight: 30
region: content
settings: { }
third_party_settings: { }
publish_state:
type: scheduler_moderation
weight: 30
region: content
settings: { }
third_party_settings: { }
scheduler_settings:
weight: 20
settings: { }
third_party_settings: { }
region: content
status: status:
type: boolean_checkbox type: boolean_checkbox
weight: 8 weight: 8
...@@ -376,6 +395,18 @@ content: ...@@ -376,6 +395,18 @@ content:
size: 60 size: 60
placeholder: '' placeholder: ''
third_party_settings: { } third_party_settings: { }
unpublish_on:
type: datetime_timestamp_no_default
weight: 30
region: content
settings: { }
third_party_settings: { }
unpublish_state:
type: scheduler_moderation
weight: 30
region: content
settings: { }
third_party_settings: { }
url_redirects: url_redirects:
weight: 18 weight: 18
region: content region: content
......
...@@ -33,6 +33,12 @@ content: ...@@ -33,6 +33,12 @@ content:
size: 60 size: 60
placeholder: '' placeholder: ''
third_party_settings: { } third_party_settings: { }
publish_on:
type: datetime_timestamp_no_default
weight: 30
region: content
settings: { }
third_party_settings: { }
status: status:
type: boolean_checkbox type: boolean_checkbox
settings: settings:
...@@ -45,5 +51,11 @@ content: ...@@ -45,5 +51,11 @@ content:
settings: { } settings: { }
third_party_settings: { } third_party_settings: { }
region: content region: content
unpublish_on:
type: datetime_timestamp_no_default
weight: 30
region: content
settings: { }
third_party_settings: { }
hidden: hidden:
path: true path: true
...@@ -33,6 +33,12 @@ content: ...@@ -33,6 +33,12 @@ content:
size: 60 size: 60
placeholder: '' placeholder: ''
third_party_settings: { } third_party_settings: { }
publish_on:
type: datetime_timestamp_no_default
weight: 30
region: content
settings: { }
third_party_settings: { }
status: status:
type: boolean_checkbox type: boolean_checkbox
settings: settings:
...@@ -45,5 +51,11 @@ content: ...@@ -45,5 +51,11 @@ content:
settings: { } settings: { }
third_party_settings: { } third_party_settings: { }
region: content region: content
unpublish_on:
type: datetime_timestamp_no_default
weight: 30
region: content
settings: { }
third_party_settings: { }
hidden: hidden:
path: true path: true
...@@ -5,6 +5,7 @@ dependencies: ...@@ -5,6 +5,7 @@ dependencies:
- entity_browser_block_layout - entity_browser_block_layout
- menu_ui - menu_ui
- node_revision_delete - node_revision_delete
- scheduler
third_party_settings: third_party_settings:
entity_browser_block_layout: entity_browser_block_layout:
entity_browser_block_layout_view_modes: entity_browser_block_layout_view_modes:
...@@ -25,6 +26,19 @@ third_party_settings: ...@@ -25,6 +26,19 @@ third_party_settings:
minimum_revisions_to_keep: 50 minimum_revisions_to_keep: 50
minimum_age_to_delete: 0 minimum_age_to_delete: 0
when_to_delete: 0 when_to_delete: 0
scheduler:
expand_fieldset: when_required
fields_display_mode: vertical_tab
publish_enable: true
publish_past_date: error
publish_past_date_created: false
publish_required: false
publish_revision: true
publish_touch: true
show_message_after_update: true
unpublish_enable: true
unpublish_required: false
unpublish_revision: true
name: Event name: Event
type: uw_ct_event type: uw_ct_event
description: 'Events are gatherings or activities that that happen on a specific date (and optionally, time).' description: 'Events are gatherings or activities that that happen on a specific date (and optionally, time).'
......
name: UW Event name: 'UW Event'
type: module type: module
package: WCMS package: WCMS
core_version_requirement: '^8.9 || ^9' core_version_requirement: '^8.9 || ^9'
...@@ -37,6 +37,8 @@ dependencies: ...@@ -37,6 +37,8 @@ dependencies:
- 'drupal:user' - 'drupal:user'
- 'drupal:views' - 'drupal:views'
- 'drupal:views_autocomplete_filters' - 'drupal:views_autocomplete_filters'
- 'scheduler:scheduler'
- 'scheduler_content_moderation_integration:scheduler_content_moderation_integration'
- 'simple_sitemap:simple_sitemap' - 'simple_sitemap:simple_sitemap'
- 'term_reference_tree:term_reference_tree' - 'term_reference_tree:term_reference_tree'
- 'uw_cfg_common:uw_cfg_common' - 'uw_cfg_common:uw_cfg_common'
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
*/ */
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\node\Entity\Node;
use Drupal\views\ViewExecutable; use Drupal\views\ViewExecutable;
/** /**
...@@ -116,24 +115,41 @@ function uw_ct_event_preprocess_views_view_unformatted(&$variables) { ...@@ -116,24 +115,41 @@ function uw_ct_event_preprocess_views_view_unformatted(&$variables) {
$variables['view']->getDisplay()->display['id'] == 'event_page' $variables['view']->getDisplay()->display['id'] == 'event_page'
) { ) {
// Services we are going to use.
$uwNodeContent = \Drupal::service('uw_cfg_common.uw_node_content'); $uwNodeContent = \Drupal::service('uw_cfg_common.uw_node_content');
$uwNodeFieldData = \Drupal::service('uw_cfg_common.uw_node_field_value');
// For each row, get the data out and the node data. // For each row, get the data out and the node data.
foreach ($variables['rows'] as $row) { foreach ($variables['view']->result as $result) {
// Load the node. // Get the date value from the view.
$node = Node::load($row['content']['#node']->nid->value); $value = $result->node__field_uw_event_date_field_uw_event_date_value;
// Get the node data. // Get the node, which is the entity of the result in the view.
$node = $result->_entity;
// Get all the dates from the node.
$dates = $node->field_uw_event_date->getValue();
// Load the node data using the node content service.
$node_data = $uwNodeContent->getNodeContent($node, 'teaser', 'all'); $node_data = $uwNodeContent->getNodeContent($node, 'teaser', 'all');
// Get the date info. // Step through all the dates and once we find the
$date['value'] = $row['content']['#node']->node__field_uw_event_date_field_uw_event_date_value; // date that is in the view, get the values from the
$date['end_value'] = $row['content']['#node']->node__field_uw_event_date_field_uw_event_date_end_value; // node field data service.
$date['duration'] = $row['content']['#node']->node__field_uw_event_date_field_uw_event_date_duration; foreach ($dates as $date) {
// If we find the date from the view, get the values
// from the node field data service.
if ($date['value'] == $value) {
// Set the date on the node data. // Get the date data and replace in the header.
$node_data['date'] = [$uwNodeContent->getDate($date, 'event')]; $node_data['header']['date'] = [$uwNodeFieldData->getDate($date, 'event')];
// Break from the loop to save computational time.
break;
}
}
// Set a variable for the node data. // Set a variable for the node data.
$variables['node_data'][] = $node_data; $variables['node_data'][] = $node_data;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment