Skip to content

Commit

Permalink
UHF-10259: Remove disable_field dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremysteerio committed Oct 21, 2024
1 parent 7603be8 commit 9c14e55
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ dependencies:
- field.storage.paragraph.field_all_events_link
- paragraphs.paragraphs_type.curated_event_list
module:
- disable_field
- link
third_party_settings:
disable_field:
add_disable: none
edit_disable: none
id: paragraph.curated_event_list.field_all_events_link
field_name: field_all_events_link
entity_type: paragraph
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ dependencies:
config:
- field.storage.paragraph.field_events
- paragraphs.paragraphs_type.curated_event_list
module:
- disable_field
third_party_settings:
disable_field:
add_disable: none
edit_disable: none
id: paragraph.curated_event_list.field_events
field_name: field_events
entity_type: paragraph
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ function helfi_paragraphs_curated_event_list_paragraph_view(

foreach ($entities as $item) {
$item->addCacheableDependency($entity);
$end_timestamp = $item->end_time->date->getTimeStamp();
/** @var \Drupal\datetime\Plugin\Field\FieldType\DateTimeItem */
$end_time = $item->get('end_time')->first();
$end_timestamp = $end_time->date->getTimeStamp();
$has_ended = $end_timestamp < $time;

$build[$has_ended ? 'past_events' : 'future_or_ongoing'][] = Drupal::entityTypeManager()
Expand Down

0 comments on commit 9c14e55

Please sign in to comment.